From 993bb5c89df8b770cdb7b7cf90d9e9623c19f070 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 19 Sep 2016 10:38:42 +0100 Subject: [PATCH] Pass close_scalar postMessage action through to the dispatcher --- src/ScalarMessaging.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 6fd2263d8c..db2baa433b 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -298,7 +298,12 @@ const onMessage = function(event) { url = url.substr(0, url.length - 1); } if (url !== event.origin) { - console.warn("Unauthorised postMessage received. Source URL: " + event.origin); + return; // don't log this - debugging APIs like to spam postMessage which floods the log otherwise + } + + if (event.data.action === "close_scalar") { + dis.dispatch({ action: "close_scalar" }); + sendResponse(event, null); return; }