Safari must log and show developers the errors from service workers for web extensions.

Hi, my Safari web extension produces an error in the published version, but not in my local development version. It is difficult to debug because Safari does not show the text of errors for service workers. Chrome does do this. The text of this error message is critical for developers.

The extension is called Reveddit Real-Time and I converted it from an existing Chrome/Firefox extension using the guide "Converting a web extension for Safari". The bug I'm encountering does not exist in the Chrome/Firefox versions.

After installing the App Store version on Safari, and granting approval for the necessary websites, it sometimes says "The service_worker script failed to load due to an error."

Since the text of the error itself does not appear, I can't be sure what happened.

If I reinstall, the extension may load, but it freezes when I click a link in the extension's popup. I believe the issue is with this line of code:

browser.runtime.sendMessage({action: 'update-badge'}) (fired via a click event here)

The bug only occurs when the background page is not loaded. That is indicated under "Develop -> Web Extension Background Pages -> reveddit real-time (not loaded)"

Shouldn't a user action reload the extension automatically? I'm confused why the behavior is different on Safari and I wonder if Apple is still working on support for web extensions or not.

Also, am I supposed to run xcrun, recreating the xcode project every time i want to update the code? It seems like this is the only way, but I'm worried this will somehow disconnect my project from the signing and uploading process I already went through.

Thanks in advance.

Safari must log and show developers the errors from service workers for web extensions.
 
 
Q