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