diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-03-02 15:33:23 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-03-02 15:33:23 +0100 |
commit | 13a8f36cad4d5d2ffec788ff6b4d5b61ed4ddff9 (patch) | |
tree | 366c6fa1fca6805ce3fda1288463f40a1f4c838d /lib/wallet/wxMessaging.ts | |
parent | 18904a4a6d7b59f7baaddbe36f68288987a346b2 (diff) | |
download | wallet-core-13a8f36cad4d5d2ffec788ff6b4d5b61ed4ddff9.tar.xz |
re-inject extension on load
Diffstat (limited to 'lib/wallet/wxMessaging.ts')
-rw-r--r-- | lib/wallet/wxMessaging.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/wallet/wxMessaging.ts b/lib/wallet/wxMessaging.ts index 4f496861d..daa9ec197 100644 --- a/lib/wallet/wxMessaging.ts +++ b/lib/wallet/wxMessaging.ts @@ -195,6 +195,19 @@ class ChromeNotifier implements Notifier { export function wxMain() { chrome.browserAction.setBadgeText({text: ""}); + chrome.tabs.query({}, function(tabs) { + for (let tab of tabs) { + if (!tab.url) { + return; + } + let uri = URI(tab.url); + if (uri.protocol() == "http" || uri.protocol() == "https") { + console.log("injecting into existing tab", tab.id); + chrome.tabs.executeScript(tab.id, {file: "content_scripts/notify.js"}); + } + } + }); + Promise.resolve() .then(() => { return openTalerDb(); |