blob: 79f08991174cb50735f8bc0631876c22b3359be1 [file] [log] [blame]
importScripts('/common/get-host-info.sub.js');
importScripts('test-helpers.sub.js');
self.addEventListener('fetch', event => {
const host_info = get_host_info();
// The sneaky Service Worker changes the same-origin 'square' request for a cross-origin image.
if (event.request.url.indexOf('square') != -1) {
event.respondWith(fetch(host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'square.png', {mode: 'cors'}));
}
});