Bug 801257 - System Message API: Page would wrongly handle messages to be sent to other pages. r=fabrice
authorGene Lian <clian@mozilla.com>
Sat, 13 Oct 2012 16:05:42 +0800
changeset 110627 37fead15ae60d6c042be2ba35cb61786fb8d2f4b
parent 110626 b508524e3126f07f6940aaa86687db63603f8a31
child 110628 2289b37c913dc8358edd0e2f3d6c5de3b1130b32
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersfabrice
bugs801257
milestone19.0a1
Bug 801257 - System Message API: Page would wrongly handle messages to be sent to other pages. r=fabrice
dom/messages/SystemMessageManager.js
--- a/dom/messages/SystemMessageManager.js
+++ b/dom/messages/SystemMessageManager.js
@@ -169,18 +169,19 @@ SystemMessageManager.prototype = {
   },
 
   receiveMessage: function sysMessMgr_receiveMessage(aMessage) {
     debug("receiveMessage " + aMessage.name + " - " +
           aMessage.json.type + " for " + aMessage.json.manifest +
           " (" + this._manifest + ")");
 
     let msg = aMessage.json;
-    if (msg.manifest != this._manifest)
+    if (msg.manifest != this._manifest || msg.uri != this._uri) {
       return;
+    }
 
     // Send an acknowledgement to parent to clean up the pending message,
     // so a re-launched app won't handle it again, which is redundant.
     cpmm.sendAsyncMessage(
       "SystemMessageManager:Message:Return:OK",
       { type: msg.type,
         manifest: msg.manifest,
         uri: msg.uri,