aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/contentscript.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2015-08-02 07:33:31 +0800
committerkumavis <aaron@kumavis.me>2015-08-02 07:33:31 +0800
commitcc1bb92f9d842f4d8a757358bf31c5de6c32592d (patch)
tree14f304d3e144925a7d80e82810f35c774470996d /app/scripts/contentscript.js
parent3e2e90a4fa2f38fcbe74a242450b822d579cc3c0 (diff)
downloadtangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar.gz
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar.bz2
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar.lz
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar.xz
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.tar.zst
tangerine-wallet-browser-cc1bb92f9d842f4d8a757358bf31c5de6c32592d.zip
build overhaul + basic structure
Diffstat (limited to 'app/scripts/contentscript.js')
-rw-r--r--app/scripts/contentscript.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index 23df227b4..2e50ae3a5 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -1,5 +1,16 @@
+const web3 = require('web3')
+
+// inject script tag
var scriptTag = document.createElement('script')
scriptTag.src = chrome.extension.getURL('scripts/web3.js')
-
scriptTag.onload = function() { debugger; this.parentNode.removeChild(this) }
-;(document.head||document.documentElement).appendChild(scriptTag)
+var container = document.head || document.documentElement
+container.appendChild(scriptTag)
+
+// listen for messages
+var port = chrome.runtime.connect({name: 'metamask'})
+port.postMessage({joke: 'Knock knock'})
+port.onMessage.addListener(function(msg) {
+ console.log(msg)
+ // port.postMessage({answer: 'Madame'})
+}) \ No newline at end of file