lapcat / SafariExtensions

Resources for the development of Safari extensions
42 stars 3 forks source link

Service worker will crash when trying to start loading up again #42

Open pmstani opened 6 months ago

pmstani commented 6 months ago

This crash is related to the following simultaneous conditions:

The extension is configured for Manifest 3. The extension is configured with a content script for a particular host. The user has granted the extension permission to access the content script host The user has navigated to an extension page, e.g. safari-web-extension:///index.html Enough time (~30 secs) has elapsed and service worker is shut down normally (status = "not loaded") When the service worker starts up again, it will crash, resulting in status = "failed to load". It can take 2 unload/reload cycles for the crash to happen.

Repro here: https://github.com/getchardy/safari-extension-bug-service-worker-crash

g-sam commented 5 months ago

This sounds like it might be the same as https://github.com/lapcat/SafariExtensions/issues/39

For what it's worth this error became much rarer for me after upgrading to a recent (M2) mac. It would happen all the time on my old Intel Mac Mini.

xeenon commented 5 months ago

Is this any better in Safari Technology Preview 192?

pmstani commented 5 months ago

Unfortunately not :(