Languages

Menu
Sites
Language
serviceWorker support?

Testing for ('serviceWorker' in navigator) appears to show support for them however when I try to register the service worker file I get the following error in the chrome developer/debugger:

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: No URL is associated with the caller's document.

Has anyone figured out how to register service workers? Am I going down a rabbit hole?

Help! Thanks.

Responses

2 Replies
Kyle Kirkpatrick

I believe I found the reason... it appears tizen (wearable) runs web apps from file:// and not a web server. serviceWorkers requires being served from a URL for security reasons. Am I understanding this correctly? Is there a workaround? :)

Kyle Kirkpatrick

Another thought on the subject, can Concent Security Policies be used to allow service workers to run from file:// ?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src

I noticed I can set them in the config.xml file.