aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-07 13:56:07 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-07 13:56:07 +0800
commita1fdf28a7bff23a1d084da8a91909aeaa969bb73 (patch)
tree5ff51a4a10d339ec51036a18a23bfa7bee869921 /app
parent9e0d9b88ccf4348ab9ac21f8fc3d64738dac5b40 (diff)
parentecfe720b8bb0429c2d73b3a03d5dbf1d7cf573a7 (diff)
downloadtangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar.gz
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar.bz2
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar.lz
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar.xz
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.tar.zst
tangerine-wallet-browser-a1fdf28a7bff23a1d084da8a91909aeaa969bb73.zip
Merge branch 'master' into ConfirmationStyle
Diffstat (limited to 'app')
-rw-r--r--app/scripts/contentscript.js6
-rw-r--r--app/scripts/inpage.js5
2 files changed, 6 insertions, 5 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index f4f064163..60b37284e 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -1,14 +1,13 @@
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
const PortStream = require('./lib/port-stream.js')
const ObjectMultiplex = require('./lib/obj-multiplex')
-// const urlUtil = require('url')
if (shouldInjectWeb3()) {
setupInjection()
+ setupStreams()
}
function setupInjection(){
-
// inject in-page script
var scriptTag = document.createElement('script')
scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
@@ -16,6 +15,9 @@ function setupInjection(){
var container = document.head || document.documentElement
// append as first child
container.insertBefore(scriptTag, container.children[0])
+}
+
+function setupStreams(){
// setup communication to page and plugin
var pageStream = new LocalMessageDuplexStream({
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index e6f4078c8..f5e54cd7b 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -1,12 +1,11 @@
+/*global Web3*/
cleanContextForImports()
-const Web3 = require('web3')
+require('web3/dist/web3.min.js')
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
const setupDappAutoReload = require('./lib/auto-reload.js')
const MetamaskInpageProvider = require('./lib/inpage-provider.js')
restoreContextAfterImports()
-// remove from window
-delete window.Web3
//
// setup plugin communication