1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #1241 from MetaMask/i1237-xmlfix2

Modify logic for injection conditions.
This commit is contained in:
Dan Finlay 2017-03-22 15:54:52 -07:00 committed by GitHub
commit 205161c489

View File

@ -69,14 +69,10 @@ function shouldInjectWeb3 () {
} }
function isAllowedSuffix (testCase) { function isAllowedSuffix (testCase) {
var prohibitedTypes = ['xml', 'pdf'] const doctype = window.document.doctype
var currentUrl = window.location.href if (doctype) {
var currentRegex return doctype.name === 'html'
for (let i = 0; i < prohibitedTypes.length; i++) { } else {
currentRegex = new RegExp(`\.${prohibitedTypes[i]}$`) return false
if (currentRegex.test(currentUrl)) {
return false
}
} }
return true
} }