From f2d243443b76560cc52c3354333d22bde3f2a9d0 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 7 Jul 2017 17:44:25 +0100 Subject: [PATCH] Suppress more errors from spurious postMessage calls on the demo instance --- src/ScalarMessaging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 1104458f22..e7767cb3cd 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -481,7 +481,7 @@ const onMessage = function(event) { // All strings start with the empty string, so for sanity return if the length // of the event origin is 0. let url = SdkConfig.get().integrations_ui_url; - if (event.origin.length === 0 || !url.startsWith(event.origin)) { + if (event.origin.length === 0 || !url.startsWith(event.origin) || !event.data.action) { return; // don't log this - debugging APIs like to spam postMessage which floods the log otherwise }