Modify logic for injection conditions.

feature/default_network_editable
Kevin Serrano 8 years ago
parent 327d18855c
commit 9906da86a4
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
  1. 12
      app/scripts/contentscript.js

@ -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]}$`)
if (currentRegex.test(currentUrl)) {
return false return false
} }
}
return true
} }

Loading…
Cancel
Save