From fda241d74d5c1c39203b64da676c684d4dc9d800 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Wed, 5 Oct 2016 00:02:04 +0200 Subject: use cloneInto when passing objects from content_script to page --- content_scripts/notify.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/notify.ts b/content_scripts/notify.ts index ed704aaf0..64f65e7e5 100644 --- a/content_scripts/notify.ts +++ b/content_scripts/notify.ts @@ -149,7 +149,11 @@ namespace TalerNotify { } let responder = (msg?: any) => { 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); }; handler(e.detail, responder); @@ -319,4 +323,4 @@ namespace TalerNotify { }); }); } -} \ No newline at end of file +} -- cgit v1.2.3