use cloneInto when passing objects from content_script to page

This commit is contained in:
tg(x) 2016-10-05 00:02:04 +02:00
parent 76bdfcb989
commit fda241d74d

View File

@ -149,7 +149,11 @@ namespace TalerNotify {
} }
let responder = (msg?: any) => { let responder = (msg?: any) => {
let fullMsg = Object.assign({}, msg, {callId}); let fullMsg = Object.assign({}, msg, {callId});
let evt = new CustomEvent(type + "-result", {detail: fullMsg}); let opts = { detail: fullMsg };
if ("function" == typeof cloneInto) {
opts = cloneInto(opts, document.defaultView);
}
let evt = new CustomEvent(type + "-result", opts);
document.dispatchEvent(evt); document.dispatchEvent(evt);
}; };
handler(e.detail, responder); handler(e.detail, responder);
@ -319,4 +323,4 @@ namespace TalerNotify {
}); });
}); });
} }
} }