Index: lib/inspectorObserver.js |
=================================================================== |
--- a/lib/inspectorObserver.js |
+++ b/lib/inspectorObserver.js |
@@ -44,20 +44,30 @@ let InspectorObserver = |
return; |
let tooltiptext = InspectorObserver.inspectorButtonTooltip; |
button = panelWindow.document.createElement("toolbarbutton"); |
button.setAttribute("id", "ehh-inspector-toolbarbutton"); |
button.setAttribute("class", "devtools-toolbarbutton"); |
button.setAttribute("tooltiptext", tooltiptext); |
button.setAttribute("tabindex", "0"); |
- button.addEventListener("command", function() |
+ button.addEventListener("command", () => |
{ |
- panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_blank", |
- "chrome,centerscreen,resizable,dialog=no", panel.selection.node); |
+ let node = panel.selection.nodeFront; |
+ if (panel.target.form.elemhidehelper) |
+ { |
+ panel.target.client.request({to: panel.target.form.elemhidehelper, type: "nodeinfo", nodeActor: node.actorID}, function(response) |
+ { |
+ if ("nodeData" in response) |
+ { |
+ panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_blank", |
+ "chrome,centerscreen,resizable,dialog=no", response.nodeData, response.host); |
+ } |
+ }); |
+ } |
}, false); |
//Override button style for light DevTools theme |
let style = panelWindow.document.createProcessingInstruction("xml-stylesheet", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); |
panelWindow.document.insertBefore(style, panelWindow.document.firstChild); |
inspectBtn.parentNode.insertBefore(button, inspectBtn); |
} |