aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-23 02:25:56 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-23 02:25:56 +0800
commit9906da86a4669c1eaf7f693398de380b2973bfe8 (patch)
treebd7328bf6410597860eda484d29e5e4ddf57669d /app
parent327d18855c4634938159ee17fca8075cadf55311 (diff)
downloadtangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar.gz
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar.bz2
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar.lz
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar.xz
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.tar.zst
tangerine-wallet-browser-9906da86a4669c1eaf7f693398de380b2973bfe8.zip
Modify logic for injection conditions.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/contentscript.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index ab64dc9fa..020208ceb 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -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
}