From 0faddb2ed2a2161be5b2af1630d583e04b750f94 Mon Sep 17 00:00:00 2001 From: Stefaan Ponnet Date: Sun, 26 Mar 2017 13:57:44 +0200 Subject: Allow injection in IFrames + dynamic IFrames --- app/manifest.json | 2 +- app/scripts/contentscript.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/manifest.json b/app/manifest.json index 910a5701e..bc1d2f866 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..09c1841bf 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -73,6 +73,6 @@ function isAllowedSuffix (testCase) { if (doctype) { return doctype.name === 'html' } else { - return false + return true } } -- cgit From 3a1f1b3bc4a11c060f0002ffa4428310ae01ba19 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 27 Mar 2017 17:43:15 -0700 Subject: Bump changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93824e71c..2ac434739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Inject web3 into loaded iFrames. + ## 3.5.1 2017-3-27 - Fix edge case where users were unable to enable the notice button if notices were short enough to not require a scrollbar. -- cgit From 0625b4a11038307673a4fcd9689e0955e10ebacf Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Mar 2017 14:30:39 -0400 Subject: Fix injection logic. --- app/scripts/contentscript.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 09c1841bf..9a390e580 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -65,14 +65,27 @@ 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' } else { - return true + 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 +} -- cgit