diff options
Diffstat (limited to 'extension/content_scripts/notify.js')
-rw-r--r-- | extension/content_scripts/notify.js | 14 |
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"); - |