diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-07-07 11:56:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-07 11:56:45 +0800 |
commit | e885c3ba09759354322677c75461aab0a35c999e (patch) | |
tree | e610aafe5dd65c1e2568a2a94d6eda4a6a072710 /app/scripts/contentscript.js | |
parent | a038eed6e3fc678246bc880afb0dacf9defac8e2 (diff) | |
parent | d892fffce2c0a73139a4052030c3e93dc8af8d9a (diff) | |
download | tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar.gz tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar.bz2 tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar.lz tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar.xz tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.tar.zst tangerine-wallet-browser-e885c3ba09759354322677c75461aab0a35c999e.zip |
Merge pull request #403 from MetaMask/fastinject
Improve web3 injection times
Diffstat (limited to 'app/scripts/contentscript.js')
-rw-r--r-- | app/scripts/contentscript.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index f4f064163..8b46f603c 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() + setTimeout(setupStreams, 200) } 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({ |