aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/contentscript.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-07-22 01:45:32 +0800
committerGitHub <noreply@github.com>2016-07-22 01:45:32 +0800
commit6658bea8d444281491718f8eee7bc3ae42f91b69 (patch)
tree1bfc13870221528af34df95e5f64f0d73b75aa16 /app/scripts/contentscript.js
parentcdd7e40545af8e62fc586f8da120e8d05ca90653 (diff)
downloadtangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.gz
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.bz2
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.lz
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.xz
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.zst
tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.zip
Implement some cross-browser practices (#473)
* Add mozilla plugin key to manifest * Move all chrome references into platform-checking module Addresses #453 * Add chrome global back to linter blacklist * Add tests
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 60b37284e..0ffe93e3c 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -1,6 +1,7 @@
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
const PortStream = require('./lib/port-stream.js')
const ObjectMultiplex = require('./lib/obj-multiplex')
+const extension = require('./lib/extension')
if (shouldInjectWeb3()) {
setupInjection()
@@ -10,7 +11,7 @@ if (shouldInjectWeb3()) {
function setupInjection(){
// inject in-page script
var scriptTag = document.createElement('script')
- scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
+ scriptTag.src = extension.extension.getURL('scripts/inpage.js')
scriptTag.onload = function () { this.parentNode.removeChild(this) }
var container = document.head || document.documentElement
// append as first child
@@ -25,7 +26,7 @@ function setupStreams(){
target: 'inpage',
})
pageStream.on('error', console.error.bind(console))
- var pluginPort = chrome.runtime.connect({name: 'contentscript'})
+ var pluginPort = extension.runtime.connect({name: 'contentscript'})
var pluginStream = new PortStream(pluginPort)
pluginStream.on('error', console.error.bind(console))
@@ -49,4 +50,4 @@ function setupStreams(){
function shouldInjectWeb3(){
var shouldInject = (window.location.href.indexOf('.pdf') === -1)
return shouldInject
-} \ No newline at end of file
+}