怎样判断当前窗口是否处在加密环境

即: https:// 为加密环境, http:// 为非加密环境. 

需要使用window.isSecureContext; 如果是https, 则返回true, 反之返回false;

window.isSecureContext; // true

 

posted on 2019-10-19 10:49  aisowe  阅读(186)  评论(0编辑  收藏  举报

导航