DEV Community

Discussion on: What's the Craziest Question You Ever Asked on Stack Overflow?

Collapse
 
_bigblind profile image
Frederik 👨‍💻➡️🌐 Creemers

I wasn't sure what the craziest one would be, but here's the one with the most views/votes, and I think it's definitely interesting.

How to create a Web Worker from a string?

At one point, I had the idea to build a web application with JavaScript challenges. I wanted to avoid the hassle of finding a way to safely run the code server side, so I decided to run the submitted code in a web worker.

I initially tried creating a data URI from the javascript code, but kept getting the error that it was a cross-origin violation. The solution ended up being creating a Blow, and getting an object URI for it.