From f69701d705d519fa0c5f9e39e6ff3a3a3bf41477 Mon Sep 17 00:00:00 2001 From: Rosano Date: Thu, 12 Sep 2019 13:04:41 -0400 Subject: [PATCH] Emit on MessageEvent --- src/document.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/document.js b/src/document.js index 523b915db..d9bf52d6f 100644 --- a/src/document.js +++ b/src/document.js @@ -456,6 +456,10 @@ function setupWindow(window, args) { event.initMessageEvent('message', false, false, data, eventOrigin, null, source, []); this.dispatchEvent(event); + + const handled = browser.emit('message', data); + if (!handled) + browser.log('Unhandled message("%s")'); }; // Inject HTMLDocument.hasFocus function