Skip to content

fix: Inject Javascript to Remove Service Worker on iOS from WkWebView #56

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tyschenko
Copy link

@Tyschenko Tyschenko commented Jun 17, 2025

We have a problem with opening some websites which rely on Service Workers and don't handle their unavailable state. For example, https://www.niftyisland.com is crashing on iOS:

Screenshot

image (1)

Service Workers are not supported on iOS in WkWebView:
https://developer.apple.com/forums/thread/773539
https://stackoverflow.com/questions/63674612/wkwebview-service-workers

To prevent such crashes we can inject Javascript code to mock Service Workers if they're not supported. This mock won't do anything except preventing the problem.

Screenshot of working website

Simulator Screenshot - iPhone 16 Plus - 2025-06-11 at 16 16 12

…w. Remove Service workers from all websites on iOS in the WkWebView to prevent the crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant