- From: Makoto Shimazu <notifications@github.com>
- Date: Thu, 22 Aug 2019 19:35:11 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 23 August 2019 02:35:33 UTC
If we think the header state is stick to clients, does exposing the white list and the black list to client API make sense? For example, if we can get/set the values via clients, the service worker can do something like this: ```javascript self.addEventListener('activate', e => { e.waitUntil(async () => { (await Clients.matchAll()).forEach(client => { // client.fetchEventAllowedScopes == ['/previously-set-allowed-scope'] // client.fetchEventDisallowedScopes == ['/previously-set-disallowed-scope'] await Promise.all( client.setFetchEventAllowedScopes(['/foo/', '/bar/']), client.setFetchEventDisallowedScopes(['/foo/posts/']); // client.fetchEventAllowedScopes == ['/foo/', '/bar/'] // client.fetchEventDisallowedScopes == ['/foo/posts/'] }); }); }); ``` while I'm feeling that it might look more like the dynamic routing and be a big hammer. -- 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/1454#issuecomment-524149200
Received on Friday, 23 August 2019 02:35:33 UTC