Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/aardvark.js

Issue 29332902: Issue 3443 - Use process script instead of a frame script in Element Hiding Helper (Closed)
Patch Set: Created Dec. 21, 2015, 12:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/aardvark.js
===================================================================
--- a/lib/aardvark.js
+++ b/lib/aardvark.js
@@ -584,48 +584,46 @@ let Aardvark = exports.Aardvark =
this.lockedAnchor = null;
this.boxElem = null;
E = id => null;
return false;
},
select: function(elem)
{
- if (!elem)
+ if (!elem || !this.window)
saroyanm 2015/12/21 16:48:55 Not sure how this fix is related to current issue.
Wladimir Palant 2015/12/21 19:14:15 I guess it's not. This merely silences an exceptio
return false;
- let browser = this.browser;
- if ("selectedBrowser" in browser) // tabbrowser element
- browser = browser.selectedBrowser;
-
+ let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"]
+ .getService(Ci.nsIMessageBroadcaster);
let messageId = ++messageCounter;
let callback = (message) =>
{
let response = message.data;
if (response.messageId != messageId)
return;
- browser.messageManager.removeMessageListener(
+ messageManager.removeMessageListener(
"ElemHideHelper:GetNodeInfo:Response",
callback
);
if (!response.nodeData)
return;
this.window.openDialog("chrome://elemhidehelper/content/composer.xul",
"_blank", "chrome,centerscreen,resizable,dialog=no", response);
this.quit();
};
- browser.messageManager.addMessageListener(
+ messageManager.addMessageListener(
"ElemHideHelper:GetNodeInfo:Response",
callback
);
- browser.messageManager.sendAsyncMessage(
+ messageManager.broadcastAsyncMessage(
"ElemHideHelper:GetNodeInfo",
messageId,
{
element: elem
}
);
return false;
},

Powered by Google App Engine
This is Rietveld