blob: 4fbe35df277ec8ffa31147b9c64f146dc09f93ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
importScripts('/common/get-host-info.sub.js');
var remoteUrl = get_host_info()['HTTPS_REMOTE_ORIGIN'] +
'/service-workers/service-worker/resources/sample.js'
self.addEventListener('fetch', event => {
if (!event.request.url.match(/opaque-response\?from=/)) {
return;
}
event.respondWith(fetch(remoteUrl, {mode: 'no-cors'}));
});
|