Prefer isSecureContext if available

This commit is contained in:
rugk 2019-06-21 19:48:16 +02:00
parent a1b1efeae2
commit e5974d4663
No known key found for this signature in database
GPG key ID: 05D40A636AFAB34D
3 changed files with 8 additions and 3 deletions

View file

@ -4577,6 +4577,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
function isInsecureConnection()
{
// use .isSecureContext if available
if (window.isSecureContext === true || window.isSecureContext === false) {
return !window.isSecureContext;
}
const url = new URL(window.location);
// HTTP is obviously insecure