-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox extension does not switch to the PWA any more since Firefox 103.0 #877
Comments
I downloaded a few Firefox versions from https://ftp.mozilla.org/pub/firefox/releases/ (linux 64-bits versions), ran them in a VM, and tested to switch to SW mode in Kiwix extension on each:
(if you try to reproduce, don't get fooled by the fact that these versions have auto-update enabled: on restart, you can end up on latest version instead of the one you extracted) |
I probably found the relevant change in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1593931 |
The first solution I would think of would be to switch to the PWA if the protocol is It would work for recent versions of Firefox, but could be a problem for some old versions that really do not support ServiceWorkers (or have it disabled). In this case, the extension would suggest a switch to the PWA, that would not work either. Based on https://caniuse.com/serviceworkers , the affected versions would be:
We should test if the behavior is acceptable on these browser versions. At the very least, the user should be able to switch back to local jQuery mode. |
This is necessary for Firefox >=103, where the ServiceWorker API has been removed in WebExtensions. See https://hg.mozilla.org/integration/autoland/rev/3a2907ad88e8 Fixes #877
This is necessary for Firefox >=103, where the ServiceWorker API has been removed in WebExtensions. See https://hg.mozilla.org/integration/autoland/rev/3a2907ad88e8 Fixes #877
This is necessary for Firefox >=103, where the ServiceWorker API has been removed in WebExtensions. See https://hg.mozilla.org/integration/autoland/rev/3a2907ad88e8 Fixes #877
Maybe we should quickly release a new kiwix-js version with this fix? |
Yes, I agree. We don't want people using the extension suddenly finding that they can't switch to SW mode, especially given the aggressive updating that all modern browsers do without giving users much control over it. |
OK I'll create the ticket with the TODO-list |
The ServiceWorker API has been removed inside a Webextension. With Firefox<103, the API was available, but registering a ServiceWorker was failing on a security issue. Since Firefox 103, the API is not available at all. It's a significant change, that broke our kiwix extension (see kiwix/kiwix-js#877). So I think it's worth mentioning it here.
On several devices where I have kiwix-js 3.4.0 Firefox extension installed, it no longer switches to the PWA when trying to use the ServiceWorker mode.
It says "The ServiceWorker API is not available on your device. Falling back to JQuery mode".
I suspect that there has been a change in Firefox behavior, in version 103.0.
In previous version of Firefox, the ServiceWorker API was available in extensions (
'serviceWorker' in navigator
returnedtrue
), but failed to register. And we trapped this registraion exception to propose a switch to the PWA (when inside a Firefox extension).In my current version (103.0 64 bits on Ubuntu),
'serviceWorker' in navigator
now returnsfalse
in the extension, so kiwix-js does not propose to use the PWA, and fallbacks to jQuery mode.I do not see any mention of this change in https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/103 so am not 100% sure
The text was updated successfully, but these errors were encountered: