tenfourfox/dom/workers/test/serviceworkers/register_https.html
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

22 lines
547 B
HTML

<!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");
navigator.serviceWorker.register("empty.js", {scope: "register-https"})
.then(reg => {
ok(false, "Registration should fail");
done();
}).catch(err => {
ok(err.name === "SecurityError", "Registration should fail with SecurityError");
done();
});
</script>