aboutsummaryrefslogtreecommitdiff
path: root/extension/content_scripts/notify.js
blob: 94356cf529a3b0b839c2caf638504a78a421a32b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Script that is injected into pages in order to allow merchants pages to
// query the availability of Taler.

'use strict';

// 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");
  document.body.addEventListener('taler-checkout-probe', function(e) {
    let evt = new Event('taler-wallet-present');
    document.body.dispatchEvent(evt);
    console.log("merchant handshake done");
  });
  document.body.addEventListener('taler-wire-probe', function(e) {
    let evt = new Event('taler-wallet-present');
    document.body.dispatchEvent(evt);
    console.log("bank handshake done");
  });
});

console.log("Taler wallet: content page loaded");