-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Consider adding the option to use the PWA in SW mode inside the Chrome extension (as prerequisite for Zimit support) #992
Comments
I've pretty much exhausted attempts to use either a nested iframe or a Shadow DOM within the app's iframe under MV3: see #986. None of these techniques are flexible enough, or else they are blocked by MV3 policies. I now need to test whether the PWA trick works under MV3 in Chromium browsers. |
This option is confirmed to be working (offline also) in Chrome-Extension under Manifest v3. It successfully bypasses the restriction on inline JS by navigating to the PWA, and back to the extension if the user switches back to jQuery mode. The extension can launch the PWA fully offline (after the first visit). There is a working version of this MV3 Chrome Extension in #984. Should I keep the local SW mode, but warn the user that inline JS is not supported in this mode? |
@kelson42 Are you in agreement with the proposed UI above for Chromium extensions only (with MV3*)? The extra option (ServiceWorkerLocal) will be hidden and non-functional in Firefox, at least until Service Workers are enabled in Firefox's MV3 (they are currently disabled still). The local option (what currently runs in Chromium extensions) is limited because, as you know, it can't run The main reason for introducing an extra option in Chromium extensions is to support Zimit / WARC, since we cannot control the use of inline JS in those ZIMs, so we need a more flexible solution than either MV2 or MV3 can offer. I have tried every possibility I can think of in #984 and #986, but nothing else works. The reason for keeping the local option in Chromium Extensions is so that the extension can still provide standard ZIM access in 100% offline situations (e.g. where someone has installed the extension from a USB stick). Admittedly, such situations are rare. *MV3 = Extension Manifest Version 3 |
Due to the continued restriction on inline JS, which is not alleviated by MV3 (Cheomium extension manifest v3) , I am considering using the same mechanism in the Chromium extension as we use in the Firefox extension for ServiceWorker mode, i.e. send the user to the offline-first moz-extension PWA.
Although we can fix the use of inline JS in the openZIM-produced scrapers (see #865), we will never be able to ban use of inline JS in Zimit ZIMs, as they come from "wild" and unpredictable sources.
As a prerequisite for supporting Zimit (upcoming Hackathon), it seems necessary to have more flexibility. This means that the extension, like the Mozilla extension, would effectively be a "shell" that redirects the user to a Progressive Web App, which is much more flexible than an extension.
Although I have #986, which could provide that flexibility, it's a major re-engineering effort, and I'm not sure it'll provide the flexibility even then.
@kelson42 Any advice?
The text was updated successfully, but these errors were encountered: