summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/workers/test/serviceworkers/fetch.js')
-rw-r--r--dom/workers/test/serviceworkers/fetch.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/workers/test/serviceworkers/fetch.js b/dom/workers/test/serviceworkers/fetch.js
new file mode 100644
index 000000000..38d20a638
--- /dev/null
+++ b/dom/workers/test/serviceworkers/fetch.js
@@ -0,0 +1,11 @@
+addEventListener('fetch', function(event) {
+ if (event.request.url.indexOf("fail.html") !== -1) {
+ event.respondWith(fetch("hello.html", {"integrity": "abc"}));
+ } else if (event.request.url.indexOf("fake.html") !== -1) {
+ event.respondWith(fetch("hello.html"));
+ }
+});
+
+addEventListener("activate", function(event) {
+ event.waitUntil(clients.claim());
+});