Can/should HTML5 Web Workers use CORS for cross-origin?
I ran into an interesting problem while creating a hosted API that relies on web workers. I was hoping to get a little community feedback on it. My server is set up with the appropriate CORS headers to deliver the worker JS files and can be retrieved with an XMLHttpRequest object. However, when the URL is given to new Worker() it fails to build, citing the origin being the problem. This seems to be an issue on both Firefox and Chrome. Check it out for yourself, and my workaround, here: http://jsfiddle.net/5ag42hb1/11/ Is this not odd behaviour? Mozilla docs say that Web Workers must obey same