|
|
@ -96,7 +96,7 @@ function logStreamDisconnectWarning (remoteLabel, err) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function shouldInjectWeb3 () { |
|
|
|
function shouldInjectWeb3 () { |
|
|
|
return doctypeCheck() || suffixCheck() |
|
|
|
return doctypeCheck() && suffixCheck() && documentElementCheck() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function doctypeCheck () { |
|
|
|
function doctypeCheck () { |
|
|
@ -104,7 +104,7 @@ function doctypeCheck () { |
|
|
|
if (doctype) { |
|
|
|
if (doctype) { |
|
|
|
return doctype.name === 'html' |
|
|
|
return doctype.name === 'html' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return false |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -121,6 +121,14 @@ function suffixCheck () { |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function documentElementCheck () { |
|
|
|
|
|
|
|
var documentElement = document.documentElement.nodeName |
|
|
|
|
|
|
|
if (documentElement) { |
|
|
|
|
|
|
|
return documentElement.toLowerCase() === 'html' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function redirectToPhishingWarning () { |
|
|
|
function redirectToPhishingWarning () { |
|
|
|
console.log('MetaMask - redirecting to phishing warning') |
|
|
|
console.log('MetaMask - redirecting to phishing warning') |
|
|
|
window.location.href = 'https://metamask.io/phishing.html' |
|
|
|
window.location.href = 'https://metamask.io/phishing.html' |
|
|
|