Skip to content
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

Support ZIM files with Service Worker #341

Closed
kelson42 opened this issue Nov 26, 2020 · 16 comments
Closed

Support ZIM files with Service Worker #341

kelson42 opened this issue Nov 26, 2020 · 16 comments
Assignees

Comments

@kelson42
Copy link
Contributor

kelson42 commented Nov 26, 2020

New ZIMit based ZIM file use Service Worker.

@kelson42 kelson42 changed the title Support ZIM files with service workers Support ZIM files with service workers in Kiwix for iOS Nov 26, 2020
@automactic
Copy link
Member

TLDR: I don't think this is really possible right now.

In iOS 14, browser apps can become the default browser by using com.apple.developer.web-browser entitlement. (e.g. use Firefox as the default browser on iPhone) This AFAIK is the only way to have WkWebView support service workers right now.

Kiwix is not a generic purpose internet browser and cannot use this entitlement (I can positively say the app will be rejected if we do it), therefore there doesn't seem to be a way to support this request

See apple doc for more: link

@kelson42
Copy link
Contributor Author

I have the same analysis. Kiwix is not a Web browser, therefore not concerned by the current "web browser app" approach.

This post is of interest as well https://dev.to/ben/will-ios-14-support-service-workers-in-wkwebview-5gn.

That said, the situation is evolving and it seems possible that WKWebView will support serive workers in the future.

For the moment, I believe this is important to ignore entries with the tag _sw:yes.

We will then re-evaluate the situation in a year.

@automactic
Copy link
Member

automactic commented Dec 27, 2020

ignore entries with the tag _sw:yes

Just to be clear: you mean not to show these files in the library right? What happens if user open such a file with kiwix?

@kelson42
Copy link
Contributor Author

Yes this is what I mean. If open locally, the. The zim will display an error because it can itself detect that SW are not supported.

@automactic
Copy link
Member

What happens if user try to manually open such a file?

@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Mar 19, 2021
@kelson42
Copy link
Contributor Author

kelson42 commented May 2, 2021

Not sure, but a message should be displayed that to be displayed this ZIM file needs service workers and this is not available.

@stale stale bot removed the stale label May 2, 2021
@stale
Copy link

stale bot commented Jul 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@kelson42
Copy link
Contributor Author

This ticket should better be updated because two years have passed.

@rgaudin
Copy link
Member

rgaudin commented Apr 26, 2023

Couldn't find a definitive answer online. Seems like it's available for app-bound-domains (a selection of up to 10 static domains you declare in the app) but I could not find any information regarding custom url scheme and service workers with WKWebView. Should probably be tested but lack of information online might demonstrate a lack of interest

@stale stale bot removed the stale label Apr 26, 2023
@stephane-archer
Copy link

Do you think Mac Os has the same limitation as iOS? Do you have more alternatives than WKWebView?

@BenjaminJMueller
Copy link

Can we expect an update here in the following months? Would be highly appreciated if Zimit files would work on iOS and macOS soon.

@kelson42
Copy link
Contributor Author

@rgaudin I have seen ionic-team/capacitor#4122 which seems to confirm that SW are available for app-bounds-domain. That means that we could use such a bound-domain to allow SW:

  • Either via a custom protocol handler (but SW has to work in that context)
  • OR like we do on Kiwix for Android with our fake domain kiwix.app

@rgaudin
Copy link
Member

rgaudin commented May 22, 2023

Both needs to be tested as it's not guaranteed that it would be allowed

  • We're not sure if SW would work with custom schemes. Security Context is HTTP specific
  • We're not sure it it there's a mechanism similar to Andoid for intercepting requests shouldInterceptRequest and it it's as relaxed: we declare being on an HTTPS URL but we intercept/forge all requests (secure context here is not real)

@kelson42 kelson42 changed the title Support ZIM files with service workers in Kiwix for iOS Support ZIM files with service workers in Kiwix May 28, 2023
@kelson42
Copy link
Contributor Author

It seems that we will be able to create ZIM files without SW with Zimit in version 2.0. Therefore this feature request priority is significantly lowered.

@kelson42 kelson42 removed the iOS label May 28, 2023
@kelson42 kelson42 changed the title Support ZIM files with service workers in Kiwix Support ZIM files with Service Worker in Kiwix May 28, 2023
@kelson42 kelson42 changed the title Support ZIM files with Service Worker in Kiwix Support ZIM files with Service Worker May 28, 2023
@kelson42
Copy link
Contributor Author

Closing as this won’t be necessary anymore once zimit2 will be released.

@kelson42 kelson42 self-assigned this Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants