question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

navigator.serviceWorker is undefined inside WebView in iOS

See original GitHub issue

First of all, thank you for your amazing work. It’s truly appreciated.


Last week, Apple has released Safari 11.1 with Service Workers support. serviceWorker in navigator outputs true in Safari itself and in WebViews. I tested with Telegram, Slack and Twitter WebViews. You may test yourself this by viewing this tweet using Twitter iOS app; clicking the link within the tweet should alert true from within the WebView. However, in NativeScript WebViews 'serviceWorker' in navigator returns false.

Steps to Reproduce

Here is a fairly simple Playgound PoC: https://play.nativescript.org/?template=play-js&id=f87pPE

Expected Behavior

serviceWorker should be defined in navigator.

Actual Behavior

serviceWorker is undefined in navigator.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
simb4commented, Mar 11, 2019

Any update on that?

2reactions
erikandershedcommented, Jan 26, 2019

Is the WKWebView still not support this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

navigator.serviceWorker always undefined on mobile Chrome ...
I'm seeing navigator.serviceWorker always return undefined in mobile Chrome and mobile Firefox on both iOS and Android devices.
Read more >
Intermittently Service worker is n… | Apple Developer Forums
Intermittently Service worker is not working for webkit (WKWebview) in IOS 15.
Read more >
navigator.serviceWorker always undefined on mobile Chrome ...
Coding example for the question navigator.serviceWorker always undefined on mobile Chrome and mobile Firefox.
Read more >
ServiceWorkerContainer.register() - Web APIs | MDN
This is usually a relative URL. It is relative to the base URL of the application. By default, the scope value for a...
Read more >
Service worker overview - Chrome Developers
The Cache interface can be accessed within the service worker scope and within the scope of the main thread. This opens up tons...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found