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) |
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; |
}, |