How to determine whether the current window in an encrypted environment

Namely: https: // is encrypted environment, http: // non-encrypted environment. 

Requires window.isSecureContext; if https, it returns true, and vice versa return false;

window.isSecureContext; // true

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11703164.html