wallet-core/extension/content_scripts/notify.js

24 lines
812 B
JavaScript
Raw Normal View History

2015-11-25 20:41:31 +01:00
// Script that is injected into pages in order to allow merchants pages to
// query the availability of Taler.
2015-12-03 20:07:03 +01:00
'use strict';
2015-11-25 20:41:31 +01:00
// Install our handshake handlers only once the
// document is loaded
// TODO: change the spec to do it on the body
document.addEventListener("DOMContentLoaded", function(e) {
console.log("DOM fully loaded and parsed");
2015-12-03 20:07:03 +01:00
document.body.addEventListener('taler-checkout-probe', function(e) {
let evt = new Event('taler-wallet-present');
document.body.dispatchEvent(evt);
console.log("merchant handshake done");
2015-12-03 20:07:03 +01:00
});
document.body.addEventListener('taler-wire-probe', function(e) {
let evt = new Event('taler-wallet-present');
document.body.dispatchEvent(evt);
console.log("bank handshake done");
});
});
2015-11-25 20:41:31 +01:00
console.log("Taler wallet: content page loaded");