Index: lib/aardvark.js |
=================================================================== |
--- a/lib/aardvark.js |
+++ b/lib/aardvark.js |
@@ -587,41 +587,45 @@ let Aardvark = exports.Aardvark = |
return false; |
}, |
select: function(elem) |
{ |
if (!elem) |
return false; |
+ let browser = this.browser; |
+ if ("selectedBrowser" in browser) // tabbrowser element |
+ browser = browser.selectedBrowser; |
+ |
let messageId = ++messageCounter; |
let callback = (message) => |
{ |
let response = message.data; |
if (response.messageId != messageId) |
return; |
- this.browser.selectedBrowser.messageManager.removeMessageListener( |
+ browser.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(); |
}; |
- this.browser.selectedBrowser.messageManager.addMessageListener( |
+ browser.messageManager.addMessageListener( |
"ElemHideHelper:GetNodeInfo:Response", |
callback |
); |
- this.browser.selectedBrowser.messageManager.sendAsyncMessage( |
+ browser.messageManager.sendAsyncMessage( |
"ElemHideHelper:GetNodeInfo", |
messageId, |
{ |
element: elem |
} |
); |
return false; |
}, |