From 13a8f36cad4d5d2ffec788ff6b4d5b61ed4ddff9 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 2 Mar 2016 15:33:23 +0100 Subject: re-inject extension on load --- lib/wallet/wxMessaging.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/wallet') 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(); -- cgit v1.2.3