[w3c/ServiceWorker] Pass credentials on navigator.serviceWorker.register("/service_worker.js"); (#1399)

There doesn't seem to be a way to pass credentials when calling register() in the standard: https://www.w3.org/TR/service-workers-1/#dom-serviceworker-scripturl

As per this doc:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17360912/

> Service Worker: Credentials are not sent during registration
> Author: Yannick S.
> Created: May 3, 2018
> 
> When registering a service worker with navigator.serviceWorker.register('service-worker.js') in an authenticated scenario, the request to fetch the service worker omits the Authorization header with the credentials, resulting in a 401 error. (Other browsers send credentials when fetching service workers.) The promise returned by register is rejected with TypeError: invalid argument.

I don't see the Authorization header in the request when navigator fetches `service-worker.js` in current browser implementations.

There should be an option to use credentials like in `<links>`: `<link crossorigin="use-credentials">`

-- 
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/1399

Received on Thursday, 4 April 2019 14:28:24 UTC