summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/service-workers/delay-sw.js
blob: 3f16c5058bbfe41b432b65c5820644e521014860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

/* eslint-env worker */

"use strict";

function wait(ms) {
  return new Promise(resolve => {
    setTimeout(resolve, ms);
  });
}

// Wait for one second to switch from installing to installed.
self.addEventListener("install", function (event) {
  event.waitUntil(wait(1000));
});