Index: lib/filterComposer.js |
=================================================================== |
--- a/lib/filterComposer.js |
+++ b/lib/filterComposer.js |
@@ -312,6 +312,22 @@ |
}); |
}); |
+port.on("forward", (msg, sender) => |
kzar
2018/04/16 11:08:22
If this is no longer a generic message, it's name
|
+{ |
+ let targetPage; |
+ if (msg.targetPageId) |
+ targetPage = ext.getPage(msg.targetPageId); |
+ else |
+ targetPage = sender.page; |
+ if (targetPage) |
+ { |
+ msg.payload.sender = sender.page.id; |
+ if (msg.expectsResponse) |
+ return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); |
+ targetPage.sendMessage(msg.payload); |
+ } |
+}); |
+ |
ext.pages.onLoading.addListener(page => |
{ |
// When tabs start loading we send them a message to ensure that the state |