summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/browser_base_force_refresh.html
blob: 1b0d2defe24446ebd4ad05d0ac69c5edcf5fc567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!--
  Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<script type="text/javascript">
addEventListener('load', function(event) {
  navigator.serviceWorker.register('force_refresh_browser_worker.js').then(function(swr) {
    if (!swr) {
      return;
    }
    var custom = new Event('base-register', { bubbles: true });
    document.dispatchEvent(custom);
  });

  navigator.serviceWorker.ready.then(function() {
    var custom = new Event('base-sw-ready', { bubbles: true });
    document.dispatchEvent(custom);
  });

  var custom = new Event('base-load', { bubbles: true });
  document.dispatchEvent(custom);
});
</script>
</body>
</html>