forked from mirrors/gecko-dev
This patches does the following: 1. Test fetch in service worker should be classified. 2. Test requests should not be classified when it is whitelisted. 3. Test requests should not be classified when it is a first-party. Depends on D80184 Differential Revision: https://phabricator.services.mozilla.com/D80185
10 lines
325 B
JavaScript
10 lines
325 B
JavaScript
self.addEventListener("fetch", function(event) {
|
|
let sep = "synth.html?";
|
|
let idx = event.request.url.indexOf(sep);
|
|
if (idx > 0) {
|
|
let url = event.request.url.substring(idx + sep.length);
|
|
event.respondWith(fetch(url, { credentials: "include" }));
|
|
} else {
|
|
event.respondWith(fetch(event.request));
|
|
}
|
|
});
|