I develop a web extension. The extension runs on manifest version 2. The extension has been in the Mac app store for about two years, running without issue. Its last update was roughly four months ago.
Recently, I received a couple user reports that, on Safari 17, in macOS 14.0 (Sonoma), the extension would stop working after some time had passed. Today, I updated my own machine to test, and sure enough, after some time passed, the extension stopped working, and became completely unresponsive. Here are some of the symptoms I've observed:
- The
chrome.browserAction.onClicked
listener does not fire. - The
chrome.commands.onCommand
listener does not fire. - The
chrome.contextMenus.onClicked
listener does not fire. - When the extension is in this unresponsive state, and I inspect the background script, I'm unable to use the console—it too is frozen and unresponsive. I cannot even execute expressions. Activity Monitor shows no unusual activity, and there is nothing in the background script code that would cause the script to hang like this.
- The browser page itself continues to work.
- There are no errors reported.
If I quit and reopen Safari, the extension will work again, but then stop working again after some time has passed.
Interestingly, if the extension has become unresponsive, and I open a new tab, all of the previous events that I tried and failed to fire will execute in sudden succession, as if they had all been stuck in a kind of queue and were suddenly released at once.
I've tried a few workarounds, like calling setInterval
, or executing recursive promises on timer, just to see if I could somehow keep the background script "alive". But these have not had any effect.
Has anyone else experienced this? Anyone have any tips? Thanks.