aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/contentscript.js
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-19 14:04:54 +0800
committerGitHub <noreply@github.com>2017-10-19 14:04:54 +0800
commit776e8241f0464939cc3049f7155c150e3375c623 (patch)
tree017600778515e74eaf15bf4f889e5b26638c56d7 /app/scripts/contentscript.js
parentde1da7d1b215ade650fc644adf63384a401dc240 (diff)
parenta8bba2f4b7ca714d46b2e1ca405aec3135aa23b2 (diff)
downloadtangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar.gz
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar.bz2
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar.lz
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar.xz
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.tar.zst
tangerine-wallet-browser-776e8241f0464939cc3049f7155c150e3375c623.zip
Merge pull request #2402 from chikeichan/merge
[NewUI] Merge master into NewUI-flat
Diffstat (limited to 'app/scripts/contentscript.js')
-rw-r--r--app/scripts/contentscript.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index b4708189e..ffbbc73cc 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -7,7 +7,9 @@ const ObjectMultiplex = require('obj-multiplex')
const extension = require('extensionizer')
const PortStream = require('./lib/port-stream.js')
-const inpageText = fs.readFileSync(path.join(__dirname, 'inpage.js')).toString()
+const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'scripts', 'inpage.js')).toString()
+const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('scripts/inpage.js') + '\n'
+const inpageBundle = inpageContent + inpageSuffix
// Eventually this streaming injection could be replaced with:
// https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.exportFunction
@@ -25,8 +27,7 @@ function setupInjection () {
try {
// inject in-page script
var scriptTag = document.createElement('script')
- scriptTag.src = extension.extension.getURL('scripts/inpage.js')
- scriptTag.textContent = inpageText
+ scriptTag.textContent = inpageBundle
scriptTag.onload = function () { this.parentNode.removeChild(this) }
var container = document.head || document.documentElement
// append as first child