diff --git a/service-workers/service-worker/multi-globals/current/current.https.html b/service-workers/service-worker/multi-globals/current/current.https.html new file mode 100644 index 00000000000000..82a48d409901b4 --- /dev/null +++ b/service-workers/service-worker/multi-globals/current/current.https.html @@ -0,0 +1,2 @@ + +Current page used as a test helper diff --git a/service-workers/service-worker/multi-globals/current/test-sw.js b/service-workers/service-worker/multi-globals/current/test-sw.js new file mode 100644 index 00000000000000..ca340943068c2b --- /dev/null +++ b/service-workers/service-worker/multi-globals/current/test-sw.js @@ -0,0 +1,15 @@ +'use strict'; + +this.addEventListener('install', event => { + this.skipWaiting(); +}); + +this.addEventListener('activate', event => { + clients.claim(); +}); + +this.addEventListener('fetch', event => { + if (event.request.url.includes('test.txt')) { + event.respondWith(new Response('current')); + } +}); diff --git a/service-workers/service-worker/multi-globals/incumbent/incumbent.https.html b/service-workers/service-worker/multi-globals/incumbent/incumbent.https.html new file mode 100644 index 00000000000000..4585f15b0f45d0 --- /dev/null +++ b/service-workers/service-worker/multi-globals/incumbent/incumbent.https.html @@ -0,0 +1,20 @@ + +Incumbent page used as a test helper + + + + + diff --git a/service-workers/service-worker/multi-globals/incumbent/test-sw.js b/service-workers/service-worker/multi-globals/incumbent/test-sw.js new file mode 100644 index 00000000000000..2f970a25ce6609 --- /dev/null +++ b/service-workers/service-worker/multi-globals/incumbent/test-sw.js @@ -0,0 +1,15 @@ +'use strict'; + +this.addEventListener('install', event => { + this.skipWaiting(); +}); + +this.addEventListener('activate', event => { + clients.claim(); +}); + +this.addEventListener('fetch', event => { + if (event.request.url.includes('test.txt')) { + event.respondWith(new Response('incumbent')); + } +}); diff --git a/service-workers/service-worker/multi-globals/relevant/relevant.https.html b/service-workers/service-worker/multi-globals/relevant/relevant.https.html new file mode 100644 index 00000000000000..44f42eda493c27 --- /dev/null +++ b/service-workers/service-worker/multi-globals/relevant/relevant.https.html @@ -0,0 +1,2 @@ + +Relevant page used as a test helper diff --git a/service-workers/service-worker/multi-globals/relevant/test-sw.js b/service-workers/service-worker/multi-globals/relevant/test-sw.js new file mode 100644 index 00000000000000..3cf80c54cb0ad1 --- /dev/null +++ b/service-workers/service-worker/multi-globals/relevant/test-sw.js @@ -0,0 +1,15 @@ +'use strict'; + +this.addEventListener('install', event => { + this.skipWaiting(); +}); + +this.addEventListener('activate', event => { + clients.claim(); +}); + +this.addEventListener('fetch', event => { + if (event.request.url.includes('test.txt')) { + event.respondWith(new Response('relevant')); + } +}); diff --git a/service-workers/service-worker/multi-globals/test-sw.js b/service-workers/service-worker/multi-globals/test-sw.js new file mode 100644 index 00000000000000..f5a6cc5f9dc880 --- /dev/null +++ b/service-workers/service-worker/multi-globals/test-sw.js @@ -0,0 +1,15 @@ +'use strict'; + +this.addEventListener('install', event => { + this.skipWaiting(); +}); + +this.addEventListener('activate', event => { + clients.claim(); +}); + +this.addEventListener('fetch', event => { + if (event.request.url.includes('test.txt')) { + event.respondWith(new Response('entry')); + } +}); diff --git a/service-workers/service-worker/multi-globals/url-parsing.https.html b/service-workers/service-worker/multi-globals/url-parsing.https.html new file mode 100644 index 00000000000000..1330d07805bb85 --- /dev/null +++ b/service-workers/service-worker/multi-globals/url-parsing.https.html @@ -0,0 +1,72 @@ + +register()/getRegistration() URL parsing, with multiple globals in play + + + + + + + + + + + + +