Safari 16 has a regression where the Service Worker fetch event for a web worker has an empty clientId. It works correctly in Chrome and in Safari 15. Minimal repro: https://downloads.scirra.com/labs/swworker/ Load the page. Reload it so the SW becomes active. In its fetch event it logs every fetch with its URL and clientId. Open dev tools for the service worker to see these logs. In Safari 16+ the clientId is empty for the worker fetches. In Safari 15 and Chrome it sets the correct clientId. This breaks a paid-for feature (Remote Preview) in our commercial web app Construct (www.construct.net). Please fix it ASAP.
I only see "Hello world from worker.js" in Safari 15.6.1, so this test case doesn't confirm that this is a regression. And I'm getting the same output from STP 153.
I did check iOS 15.7 and it was working there - don't forget to open the console for the Service Worker, it's easy to get mixed up between consoles...
(and don't forget the reload step to make sure the SW is active and actually intercepting fetches)
Yes, I wasn't looking at the service worker console, thank you for the clarification. I could confirm with STP, and it worked correctly with Safari 15.6.1. Didn't try Safari 16, but it's known to be broken there per your report.
<rdar://problem/100368228>
Pull request: https://github.com/WebKit/WebKit/pull/4696
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/36068
Committed 254944@main (6facf7d89d16): <https://commits.webkit.org/254944@main> Reviewed commits have been landed. Closing PR #4696 and removing active labels.
Reverted by https://github.com/WebKit/WebKit/pull/4801
Re-opening for pull request https://github.com/WebKit/WebKit/pull/4801
Committed 254966@main (828a55516a7e): <https://commits.webkit.org/254966@main> Reviewed commits have been landed. Closing PR #4801 and removing active labels.
So, reopening.
Pull request: https://github.com/WebKit/WebKit/pull/8694
Committed 259031@main (599d00ac6774): <https://commits.webkit.org/259031@main> Reviewed commits have been landed. Closing PR #8694 and removing active labels.