aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2015-08-01 09:38:02 +0800
committerkumavis <aaron@kumavis.me>2015-08-01 09:38:02 +0800
commit500a95a70492fc319ad1984da36773952a2086e6 (patch)
treef9e5f3752414c5f414379fe579d6714a48cdad1c /app/scripts
downloadtangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar.gz
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar.bz2
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar.lz
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar.xz
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.tar.zst
tangerine-wallet-browser-500a95a70492fc319ad1984da36773952a2086e6.zip
init commit
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js9
-rw-r--r--app/scripts/chromereload.js22
-rw-r--r--app/scripts/contentscript.js8
-rw-r--r--app/scripts/popup.js3
-rw-r--r--app/scripts/web3.js2
5 files changed, 44 insertions, 0 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
new file mode 100644
index 000000000..87a27d0db
--- /dev/null
+++ b/app/scripts/background.js
@@ -0,0 +1,9 @@
+'use strict';
+
+chrome.runtime.onInstalled.addListener(function (details) {
+ console.log('previousVersion', details.previousVersion);
+});
+
+chrome.browserAction.setBadgeText({text: '2'});
+
+console.log('\'Allo \'Allo! Event Page for Browser Action');
diff --git a/app/scripts/chromereload.js b/app/scripts/chromereload.js
new file mode 100644
index 000000000..a01466484
--- /dev/null
+++ b/app/scripts/chromereload.js
@@ -0,0 +1,22 @@
+'use strict';
+
+// Reload client for Chrome Apps & Extensions.
+// The reload client has a compatibility with livereload.
+// WARNING: only supports reload command.
+
+var LIVERELOAD_HOST = 'localhost:';
+var LIVERELOAD_PORT = 35729;
+var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload');
+
+connection.onerror = function (error) {
+ console.log('reload connection got error:', error);
+};
+
+connection.onmessage = function (e) {
+ if (e.data) {
+ var data = JSON.parse(e.data);
+ if (data && data.command === 'reload') {
+ chrome.runtime.reload();
+ }
+ }
+};
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
new file mode 100644
index 000000000..30cf50ef9
--- /dev/null
+++ b/app/scripts/contentscript.js
@@ -0,0 +1,8 @@
+console.log('\'Allo \'Allo! Content script')
+
+var scriptTag = document.createElement('script')
+// TODO: add "script.js" to web_accessible_resources in manifest.json
+scriptTag.src = chrome.extension.getURL('scripts/web3.js')
+
+// scriptTag.onload = function() { this.parentNode.removeChild(this) }
+;(document.head||document.documentElement).appendChild(scriptTag) \ No newline at end of file
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
new file mode 100644
index 000000000..815abcb42
--- /dev/null
+++ b/app/scripts/popup.js
@@ -0,0 +1,3 @@
+'use strict';
+
+console.log('\'Allo \'Allo! Popup');
diff --git a/app/scripts/web3.js b/app/scripts/web3.js
new file mode 100644
index 000000000..2bbf95ac3
--- /dev/null
+++ b/app/scripts/web3.js
@@ -0,0 +1,2 @@
+console.log('injecting web3....')
+window.web3 = {} \ No newline at end of file