Re: [w3c/ServiceWorker] Can't register same ServiceWorker file to different subdomain (#994)

>> shell.js:29 ServiceWorker registration failed: DOMException: Failed to register a ServiceWorker: The origin of the provided scriptURL ('https://example.com') does not match the current origin ('https://staging.example.com').
>
> Line 26 of shell.js is: `window.navigator.serviceWorker.register("/serviceworker.js")`.

This is very surprising, and certainly isn't something I can recreate locally. The registration url is resolved against `location.href`, so assuming `location.href == 'https://staging.example.com/'` I'd expect the fetched worker to be `https://staging.example.com/serviceworker.js`.

Do you have a live example of this issue?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/994#issuecomment-255328207

Received on Friday, 21 October 2016 08:50:02 UTC