Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1198 from rosano/rosano-patch-1
Browse files Browse the repository at this point in the history
Emit on MessageEvent
  • Loading branch information
assaf authored Apr 26, 2020
2 parents 991ad55 + f69701d commit e6cf0f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6cf0f8

Please sign in to comment.