(Filing bug from alchemist@)
It seems that some fetch calls to web_accessible_resources are still not working for Extension SW.
Steps:
1) from extension, register a SW to intercept fetch:
manifest.json:
..
"web_accessible_resources": ["war.html"],
background.js:
navigator.serviceWorker.register('/sw.js');
sw.js:
self.addEventListener('fetch', event => {
console.log('FETCH: ' + event.request.url); // #XYZ
if (event.request.url.endsWith('war.html')) {
event.respondWith(new Response('sw content'));
}
});
2) from page, fetch() a WAR, e.g.:
fetch('chrome-extension://abcd.../war.html').then(...);
Fetch handler in #XYZ above does not see war.html
Same goes with XHR.
However, if I load the resource through an iframe element in the page in step 2, fetch handler seems to see that. This was fixed in https://codereview.chromium.org/1532633003 & https://bugs.chromium.org/p/chromium/issues/detail?id=567382, but fetch/xhr still doesn't work.
Comment 1 by lazyboy@chromium.org
, Sep 20 2016