Merge pull request #484 from matrix-org/kegan/add-close-scalar-event

Pass close_scalar postMessage action through to the dispatcher
pull/21833/head
Kegsay 2016-09-19 10:47:51 +01:00 committed by GitHub
commit 9be1ab774d
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}