Merge branch 'master' into hideseedwordsfromlogstate

feature/default_network_editable
Dan Finlay 8 years ago committed by GitHub
commit d2bd6f3913
  1. 1
      CHANGELOG.md
  2. 2
      app/manifest.json
  3. 17
      app/scripts/contentscript.js

@ -3,6 +3,7 @@
## Current Master ## Current Master
- Remove seedWords from UI state dump. - Remove seedWords from UI state dump.
- Inject web3 into loaded iFrames.
## 3.5.1 2017-3-27 ## 3.5.1 2017-3-27

@ -51,7 +51,7 @@
"scripts/contentscript.js" "scripts/contentscript.js"
], ],
"run_at": "document_start", "run_at": "document_start",
"all_frames": false "all_frames": true
} }
], ],
"permissions": [ "permissions": [

@ -65,10 +65,10 @@ function setupStreams () {
} }
function shouldInjectWeb3 () { function shouldInjectWeb3 () {
return isAllowedSuffix(window.location.href) return doctypeCheck() || suffixCheck()
} }
function isAllowedSuffix (testCase) { function doctypeCheck () {
const doctype = window.document.doctype const doctype = window.document.doctype
if (doctype) { if (doctype) {
return doctype.name === 'html' return doctype.name === 'html'
@ -76,3 +76,16 @@ function isAllowedSuffix (testCase) {
return false return false
} }
} }
function suffixCheck() {
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
}
}
return true
}

Loading…
Cancel
Save