summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/register_https.html
blob: 572c7ce6b8d5661299c1ef49c3c603d26bb562c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<script>
function ok(condition, message) {
  parent.postMessage({type: "ok", status: condition, msg: message}, "*");
}

function done() {
  parent.postMessage({type: "done"}, "*");
}

ok(location.protocol == "https:", "We should be loaded from HTTPS");
ok(!window.isSecureContext, "Should not be secure context");
ok(!("serviceWorker" in navigator), "ServiceWorkerContainer not availalble in insecure context");
done();
</script>