Spawning a WebWorker with new Worker(“whatever.js”) works fine, but new SharedWorker(“whatever.js”) returns the error: ReferenceError: SharedWorker is not defined
What’s wrong with it?
Also I have only tried this in Firefox so far, but my application will have to run on all major browsers, so it wont help me if the SharedWorkers dont work in firefox while working correctly in other browsers…
It hasn’t been implemented in Firefox yet.
https://developer.mozilla.org/en-US/docs/DOM/SharedWorker
Support list is here:
http://caniuse.com/sharedworkers
It will be available in Firefox v 16.0 and IE 10.
Chrome and Safari (Webkit) supports it already.