mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
7d9fd70298
The spec mandates that ServiceWorkerContainer only be visible in a secure context, yet currently it is (almost) always visible, but rejects calls to register() in non-secure contexts. This commit moves the context check to a [Func] function, thus implementing the behavior exactly as specified. This commit uses the same mechanism used by [SecureContext] bindings instead of the current ad hoc implementation. Differential Revision: https://phabricator.services.mozilla.com/D2950 --HG-- extra : moz-landing-system : lando
15 lines
385 B
HTML
15 lines
385 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");
|
|
ok(!("serviceWorker" in navigator), "ServiceWorkerContainer not availalble in insecure context");
|
|
done();
|
|
</script>
|