[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 04/28: Issue 4255 - Place Element Hiding Helper button in the DevTools toolbar if one exists

David Prévot taffit at moszumanska.debian.org
Fri Aug 4 21:15:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 36922f534f60d378e0ef7c2fb1ed82aade849655
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Wed Jul 20 12:52:17 2016 +0200

    Issue 4255 - Place Element Hiding Helper button in the DevTools toolbar if one exists
---
 lib/inspectorObserver.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/inspectorObserver.js b/lib/inspectorObserver.js
index e8899c9..0b72f5f 100644
--- a/lib/inspectorObserver.js
+++ b/lib/inspectorObserver.js
@@ -48,10 +48,18 @@ let InspectorObserver =
   inspectorReady: function(eventName, toolbox, panel)
   {
     let panelWindow = panel.panelWin;
-    let inspectBtn = panelWindow.document.getElementById("inspector-breadcrumbs");
-    if (!inspectBtn)
+    let inspectorToolbar = panelWindow.document.getElementById("inspector-toolbar");
+    if (!inspectorToolbar)
       return;
 
+    let insertBefore = inspectorToolbar.firstChild;
+    let inspectorAddButton = panelWindow.document.getElementById("inspector-element-add-button");
+    if (inspectorAddButton && inspectorAddButton.parentNode == inspectorToolbar)
+    {
+      // Firefox 48+
+      insertBefore = inspectorAddButton.nextSibling;
+    }
+
     let tooltiptext = InspectorObserver.inspectorButtonTooltip;
     let button = panelWindow.document.createElement("toolbarbutton");
     button.setAttribute("id", "ehh-inspector-toolbarbutton");
@@ -83,7 +91,7 @@ let InspectorObserver =
     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);
+    inspectorToolbar.insertBefore(button, insertBefore);
   }
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list