I fail to get subworkers to work in Safari: https://bugs.webkit.org/show_bug.cgi?id=255402.
This are Firefox 🦊 and Chrome 🛞:
main thread → spawns worker.js → spawns subworker.js
This is Safari 🧭:
main thread → spawns worker.js ↛ fails to spawn subworker.js
There're even two polyfills (https://github.com/dmihal/Subworkers, https://github.com/johanholmerin/nested-worker), but neither of them seems to fix it. I feel like I'm missing something… This holds back SQLite Wasm backed by the OPFS to work on Safari.
@tomayac @jensimmons @jondavis it should be shipped, given the date of landing. We wil look into it.
@tomayac @othermaciej @jensimmons @jondavis
subworkers are impemented. WPT shows it, etc.
The current test revealed that subworkers are currently not talking back to the Web Inspector, not that they are not working.
So it is working just not visible. I modified the initial webkit bug. https://bugs.webkit.org/show_bug.cgi?id=255402
Thanks for the heads up.
Just tested on Safari 16.3, and it's not working. Safari Technology Preview 165 does spawn nested worker but console log are missing.
Unsure of market share, but some detection + backup might be needed here, depending on your support matrix.
@karlcow @carlop @othermaciej @jensimmons @jondavis Just added some more details to the bug: https://bugs.webkit.org/show_bug.cgi?id=255402#c12. It seems to be indeed a Web Inspector issue.
@othermaciej @jensimmons @jondavis Thank you very much! Hope the minimal repro in the bug helps you debug this. I tried stepping through the code, but it just wouldn’t do anything visibly failing in Web Inspector. If it helps, on the server I can see a request for `subworker.js`, but the Network panel doesn’t see it, nor does Safari seem to do anything with the code—visibly. Curious to see how this happens.