summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/fetch.js
blob: 38d20a6389977ad52839e667c28bce35660e41ca (plain)
1
2
3
4
5
6
7
8
9
10
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());
});