diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-03-23 06:54:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 06:54:52 +0800 |
commit | 205161c489af0bd30b019cea6ae1a2bc5079db3e (patch) | |
tree | 319d324aad250150dbbe1b0a84cf63520f7e0390 | |
parent | d82549a1ea652d85eaa8ad941e2ed5d2f2b84ff6 (diff) | |
parent | 90d5dc636ed5bc950e02c0b18316a33153942691 (diff) | |
download | tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar.gz tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar.bz2 tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar.lz tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar.xz tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.tar.zst tangerine-wallet-browser-205161c489af0bd30b019cea6ae1a2bc5079db3e.zip |
Merge pull request #1241 from MetaMask/i1237-xmlfix2
Modify logic for injection conditions.
-rw-r--r-- | app/scripts/contentscript.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index ab64dc9fa..020208ceb 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -69,14 +69,10 @@ function shouldInjectWeb3 () { } function isAllowedSuffix (testCase) { - var prohibitedTypes = ['xml', 'pdf'] - var currentUrl = window.location.href - var currentRegex - for (let i = 0; i < prohibitedTypes.length; i++) { - currentRegex = new RegExp(`\.${prohibitedTypes[i]}$`) - if (currentRegex.test(currentUrl)) { - return false - } + const doctype = window.document.doctype + if (doctype) { + return doctype.name === 'html' + } else { + return false } - return true } |