W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
提示:在使用此功能之前,請仔細檢查瀏覽器兼容性表。
該 window.isSecureContext 只讀屬性表示上下文是否能夠使用需要功能的安全環(huán)境。
var isSecure = window.isSecureContext
您可以使用特征檢測來檢查它們是否處于安全上下文中,或通過使用全局范圍中公開的 isSecureContext 布爾值來檢查它們是否處于安全上下文中。
if (window.isSecureContext) {
// Page is a secure context so service workers are now available
navigator.serviceWorker.register("/offline-worker.js").then(function () {
...
});
}
規(guī)范 | 狀態(tài) | 注釋 |
---|---|---|
安全的上下文 | Candidate Recommendation | 初始定義 |
我們正在將兼容性數據轉換為機器可讀的JSON格式。
特征 | Chrome | Edge | Firefox(Gecko) | Internet Explorer | Opera | Safari(WebKit) |
---|---|---|---|---|---|---|
基本支持 | 支持 | 支持 | 支持:49 | ? | ? | ? |
考慮window.opener | 不支持 | 不支持 | 支持:49 | ? | ? | ? |
特征 | Android | Android Webview | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
基本支持 | 不支持 | 支持 | 支持 | 支持:49.0 | ? | ? | ? | 支持 |
考慮 window.opener | 不支持 | 支持 | 不支持 | 支持:49.0 | ? | ? | ? | ? |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯系方式:
更多建議: