mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
Merge pull request #1241 from MetaMask/i1237-xmlfix2
Modify logic for injection conditions.
This commit is contained in:
commit
205161c489
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user