aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2016-10-05 02:10:56 +0200
committertg(x) <*@tg-x.net>2016-10-05 02:10:56 +0200
commit39b3fd7fc6a1dcf0e36d3ab8e5081c268a663fad (patch)
tree1b4d03e2d6af6dbee4c952cf029308d0ce650bc1 /lib
parent5bea586218258e538cb79fcacf34f6c4bfd80ff7 (diff)
use cloneInto when passing objects from content_script to page
Diffstat (limited to 'lib')
-rw-r--r--lib/shopApi.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/shopApi.ts b/lib/shopApi.ts
index 7cc37a9db..bd0993068 100644
--- a/lib/shopApi.ts
+++ b/lib/shopApi.ts
@@ -22,7 +22,9 @@
* @author Florian Dold
*/
+"use strict";
+declare var cloneInto: any;
function subst(url: string, H_contract: string) {
url = url.replace("${H_contract}", H_contract);
@@ -122,13 +124,17 @@ export function fetchPayment(H_contract: any, offering_url: any) {
// We have the details for then payment, the merchant page
// is responsible to give it to the merchant.
- let evt = new CustomEvent("taler-notify-payment", {
+ let opts = {
detail: {
H_contract: H_contract,
contract: resp.contract,
payment: resp.payReq,
}
- });
+ };
+ if ("function" == typeof cloneInto) {
+ opts = cloneInto(opts, document.defaultView);
+ }
+ let evt = new CustomEvent("taler-notify-payment", opts);
document.dispatchEvent(evt);
});
}
@@ -166,4 +172,4 @@ function offerContractFrom(url: string) {
+ contract_request.statusText);
};
contract_request.send();
-} \ No newline at end of file
+}