Can I load a web worker script from an absolute URL?

前端 未结 3 1027
说谎
说谎 2020-12-10 20:53

I haven\'t been able to get something like this to work:

var myWorker = new Worker(\"http://example.com/js/worker.js\");

In my Firebug cons

3条回答
  •  醉话见心
    2020-12-10 21:34

    Not to mention...

    Just about anytime you have a Cross-Origin Restriction Policy, there's no counterpoise to the file system (file://path/to/file.ext) - Meaning, the file protocol triggers handling for this policy.

    This goes for "dirty images" in the Canvas API as well.

    Hope this helps =]

提交回复
热议问题