summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/test/browser/resources/service-workers/debug.html
blob: f0f16858fd57f3029b8390f543cae84849e28bf1 (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
<!-- Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/ -->

<!DOCTYPE HTML>
<html>
<head>
  <meta charset="UTF-8">
  <title>Service worker test</title>
</head>
<body>
<script type="text/javascript">
"use strict";
window.sw = navigator.serviceWorker.register("debug-sw.js");

/* exported fetchFromWorker */
async function fetchFromWorker() {
  const response = await fetch("test");
  const text = await response.text();
  console.log(`Response from worker: ${text}`);
}
</script>

<p>This page has a <code>fetchFromWorker()</code> function.</p>
</body>
</html>