OLD | NEW |
(Empty) | |
| 1 importScripts('test-helpers.js'); |
| 2 |
| 3 var port = undefined; |
| 4 |
| 5 self.onmessage = function(e) { |
| 6 var message = e.data; |
| 7 if ('port' in message) { |
| 8 port = message.port; |
| 9 port.postMessage({ready: true}); |
| 10 } |
| 11 }; |
| 12 |
| 13 self.addEventListener('fetch', function(event) { |
| 14 var url = event.request.url; |
| 15 if (url.indexOf('fetch-request-css-base-url-style.css') != -1) { |
| 16 event.respondWith(fetch( |
| 17 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() + |
| 18 'fetch-request-css-base-url-style.css', |
| 19 {mode: 'no-cors'})); |
| 20 } else if (url.indexOf('dummy.png') != -1) { |
| 21 port.postMessage({ |
| 22 url: event.request.url, |
| 23 referrer: event.request.referrer |
| 24 }); |
| 25 } |
| 26 }); |
OLD | NEW |