aboutsummaryrefslogtreecommitdiff
path: root/extension/content_scripts/notify.js
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2015-12-03 20:07:03 +0100
committertg(x) <*@tg-x.net>2015-12-03 20:07:03 +0100
commit5243a707260af9de820ad02b1972d3280164cf19 (patch)
tree46e6918fca8edfeddb919b7a89307328390a0ec1 /extension/content_scripts/notify.js
parent7b6706bee3cbecc84b330672ecdb5764d7d68756 (diff)
webext popup
Diffstat (limited to 'extension/content_scripts/notify.js')
-rw-r--r--extension/content_scripts/notify.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/extension/content_scripts/notify.js b/extension/content_scripts/notify.js
index 3a0f9001d..4a5c47c01 100644
--- a/extension/content_scripts/notify.js
+++ b/extension/content_scripts/notify.js
@@ -1,6 +1,7 @@
// Script that is injected into pages in order to allow merchants pages to
// query the availability of Taler.
+'use strict';
// Listen to messages from the backend.
chrome.runtime.onMessage.addListener(
@@ -8,11 +9,12 @@ chrome.runtime.onMessage.addListener(
// do nothing, yet
});
-
-document.addEventListener('taler-checkout-probe', function(e) {
- let evt = new Event('taler-wallet-present');
- document.dispatchEvent(evt);
-});
+if (document && document.body)
+{
+ document.body.addEventListener('taler-checkout-probe', function(e) {
+ let evt = new Event('taler-wallet-present');
+ document.body.dispatchEvent(evt);
+ });
+}
console.log("Taler wallet: content page loaded");
-