Sam Clegg
Sam Clegg
I believe the `_scriptName` code is still needed/used even if `locateFile` is specified. Specifically I think `_scriptName` is used in pthread builds when creating new workers, regardless of `locateFile`.
Can you explain why this doesn't work? Why cant you serve the main JS file from the CDN? We do have setting called `mainScriptUrlOrBlob` which controls where the main JS...
Sorry I didn't read the title there. I'm not too familiar with cross-origin limitations. If you, or anyone else, has any ideas on how to make this work better that...
So, to be clear, the security policy disassllows `new Worker` with a cross origin script but then allows the new worker to call `importScripts` from other origins?
Trying to understand the issue, the only mention I see about same-origin restrictions in workers looks like it related to subworkers: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers. Are you using subworkers? Or is this some...
Hmm ... I wonder if we could do something line `new Worker(blobUrl("importScripts(...)"` to work around this? Maybe you could even try this out by adding something like this to your...
I tried this locally and the following `--pre-js` seemed to work: ``` if (!ENVIRONMENT_IS_PTHREAD) { Module['mainScriptUrlOrBlob'] = new Blob([`importScripts('${document.currentScript.src}');`]) } ```
Nope, I'm just going by the fact that `importScripts` from your CDN worked for you in the past. So this is way to effectively revert to the prior behaviour.
I'm confused by https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers though. It seems to suggest that only sub-workers have this requirement by default? So by default, using a CDN like this should work?
Can you confirm that the `--pre-js` fix works for you your use case?