aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2017-03-29 05:42:24 +0800
committerGitHub <noreply@github.com>2017-03-29 05:42:24 +0800
commitd2bd6f3913d1b69263f7d03d6bde6b0dba2f4d79 (patch)
treee130fbead75abac8cef2853f86bbe945e0c7908d
parentc227d1944f9ee5c1143f6da9e04ab98e3da79aad (diff)
parent731f6654094fb6cac832d4092471c51b554a34d4 (diff)
downloadtangerine-wallet-browser-d2bd6f3913d1b69263f7d03d6bde6b0dba2f4d79.tar.gz
tangerine-wallet-browser-d2bd6f3913d1b69263f7d03d6bde6b0dba2f4d79.tar.zst
tangerine-wallet-browser-d2bd6f3913d1b69263f7d03d6bde6b0dba2f4d79.zip
Merge branch 'master' into hideseedwordsfromlogstate
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/manifest.json2
-rw-r--r--app/scripts/contentscript.js17
3 files changed, 17 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed824cfdf..66de9ede5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## Current Master
- Remove seedWords from UI state dump.
+- Inject web3 into loaded iFrames.
## 3.5.1 2017-3-27
diff --git a/app/manifest.json b/app/manifest.json
index 97cc7dd6d..a163d4c06 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -51,7 +51,7 @@
"scripts/contentscript.js"
],
"run_at": "document_start",
- "all_frames": false
+ "all_frames": true
}
],
"permissions": [
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index 020208ceb..9a390e580 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -65,10 +65,10 @@ function setupStreams () {
}
function shouldInjectWeb3 () {
- return isAllowedSuffix(window.location.href)
+ return doctypeCheck() || suffixCheck()
}
-function isAllowedSuffix (testCase) {
+function doctypeCheck () {
const doctype = window.document.doctype
if (doctype) {
return doctype.name === 'html'
@@ -76,3 +76,16 @@ function isAllowedSuffix (testCase) {
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
+}