OLD | NEW |
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 let InspectorObserver = | 7 let InspectorObserver = |
8 { | 8 { |
9 init: function() | 9 init: function() |
10 { | 10 { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 let insertBefore = inspectorToolbar.firstChild; | 55 let insertBefore = inspectorToolbar.firstChild; |
56 let inspectorAddButton = panelWindow.document.getElementById("inspector-elem
ent-add-button"); | 56 let inspectorAddButton = panelWindow.document.getElementById("inspector-elem
ent-add-button"); |
57 if (inspectorAddButton && inspectorAddButton.parentNode == inspectorToolbar) | 57 if (inspectorAddButton && inspectorAddButton.parentNode == inspectorToolbar) |
58 { | 58 { |
59 // Firefox 48+ | 59 // Firefox 48+ |
60 insertBefore = inspectorAddButton.nextSibling; | 60 insertBefore = inspectorAddButton.nextSibling; |
61 } | 61 } |
62 | 62 |
63 let tooltiptext = InspectorObserver.inspectorButtonTooltip; | 63 let tooltiptext = InspectorObserver.inspectorButtonTooltip; |
64 let button = panelWindow.document.createElement("toolbarbutton"); | 64 let button = panelWindow.document.createElementNS( |
| 65 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", |
| 66 "toolbarbutton" |
| 67 ); |
65 button.setAttribute("id", "ehh-inspector-toolbarbutton"); | 68 button.setAttribute("id", "ehh-inspector-toolbarbutton"); |
66 button.setAttribute("class", "devtools-toolbarbutton"); | 69 button.setAttribute("class", "devtools-toolbarbutton"); |
67 button.setAttribute("tooltiptext", tooltiptext); | 70 button.setAttribute("tooltiptext", tooltiptext); |
68 button.setAttribute("tabindex", "0"); | 71 button.setAttribute("tabindex", "0"); |
69 button.addEventListener("command", () => | 72 button.addEventListener("command", () => |
70 { | 73 { |
71 let node = panel.selection.nodeFront; | 74 let node = panel.selection.nodeFront; |
72 let target = panel.target; | 75 let target = panel.target; |
73 if (node && target.form.elemhidehelper) | 76 if (node && target.form.elemhidehelper) |
74 { | 77 { |
(...skipping 14 matching lines...) Expand all Loading... |
89 | 92 |
90 //Override button style for light DevTools theme | 93 //Override button style for light DevTools theme |
91 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet
", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); | 94 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet
", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); |
92 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); | 95 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); |
93 | 96 |
94 inspectorToolbar.insertBefore(button, insertBefore); | 97 inspectorToolbar.insertBefore(button, insertBefore); |
95 } | 98 } |
96 }; | 99 }; |
97 | 100 |
98 InspectorObserver.init(); | 101 InspectorObserver.init(); |
OLD | NEW |