OLD | NEW |
| (Empty) |
1 importScripts('../../resources/get-host-info.js'); | |
2 var host_info = get_host_info(); | |
3 | |
4 self.addEventListener('fetch', function(event) { | |
5 var url = event.request.url; | |
6 if (url.indexOf('dummy-dir') == -1) { | |
7 return; | |
8 } | |
9 var result = 'mode=' + event.request.mode + | |
10 ' credentials=' + event.request.credentials; | |
11 if (url == host_info.HTTP_ORIGIN + '/dummy-dir/same.html') { | |
12 event.respondWith(new Response( | |
13 result + | |
14 '<link id="same-same" rel="import" ' + | |
15 'href="' + host_info.HTTP_ORIGIN + '/dummy-dir/same-same.html">' + | |
16 '<link id="same-other" rel="import" ' + | |
17 ' href="' + host_info.HTTP_REMOTE_ORIGIN + | |
18 '/dummy-dir/same-other.html">')); | |
19 } else if (url == host_info.HTTP_REMOTE_ORIGIN + '/dummy-dir/other.html') { | |
20 event.respondWith(new Response( | |
21 result + | |
22 '<link id="other-same" rel="import" ' + | |
23 ' href="' + host_info.HTTP_ORIGIN + '/dummy-dir/other-same.html">' + | |
24 '<link id="other-other" rel="import" ' + | |
25 ' href="' + host_info.HTTP_REMOTE_ORIGIN + | |
26 '/dummy-dir/other-other.html">')); | |
27 } else { | |
28 event.respondWith(new Response(result)); | |
29 } | |
30 }); | |
OLD | NEW |