| OLD | NEW |
| 1 importScripts('../../resources/get-host-info.js'); | 1 importScripts('/common/get-host-info.sub.js'); |
| 2 importScripts('test-helpers.js'); | 2 importScripts('test-helpers.sub.js'); |
| 3 | 3 |
| 4 self.addEventListener('fetch', function(event) { | 4 self.addEventListener('fetch', function(event) { |
| 5 if (event.request.url.indexOf('cross-origin-css.css') != -1) { | 5 if (event.request.url.indexOf('cross-origin-css.css') != -1) { |
| 6 event.respondWith(fetch( | 6 event.respondWith(fetch( |
| 7 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() + | 7 get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() + |
| 8 'fetch-request-css-cross-origin-mime-check-cross.css', | 8 'fetch-request-css-cross-origin-mime-check-cross.css', |
| 9 {mode: 'no-cors'})); | 9 {mode: 'no-cors'})); |
| 10 } else if (event.request.url.indexOf('cross-origin-html.css') != -1) { | 10 } else if (event.request.url.indexOf('cross-origin-html.css') != -1) { |
| 11 event.respondWith(fetch( | 11 event.respondWith(fetch( |
| 12 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() + | 12 get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() + |
| 13 'fetch-request-css-cross-origin-mime-check-cross.html', | 13 'fetch-request-css-cross-origin-mime-check-cross.html', |
| 14 {mode: 'no-cors'})); | 14 {mode: 'no-cors'})); |
| 15 } else if (event.request.url.indexOf('synthetic.css') != -1) { | 15 } else if (event.request.url.indexOf('synthetic.css') != -1) { |
| 16 event.respondWith(new Response("#synthetic { color: blue; }")); | 16 event.respondWith(new Response("#synthetic { color: blue; }")); |
| 17 } else { | 17 } else { |
| 18 event.respondWith(fetch(event.request)); | 18 event.respondWith(fetch(event.request)); |
| 19 } | 19 } |
| 20 }); | 20 }); |
| OLD | NEW |