Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/inspectorObserver.js

Issue 29340697: Issue 3962 - Update developer tools module paths in Element Hiding Helper (Closed)
Patch Set: Created April 20, 2016, 5:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
11 let gDevTools; 11 let gDevTools;
12 try 12 try
13 { 13 {
14 ({gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", nul l)); 14 // Firefox 44+
15 ({gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.j sm", null));
15 } 16 }
16 catch(e) 17 catch (e)
17 { 18 {
18 // No developer tools or unsupported version - ignore. 19 try
19 return; 20 {
21 // Older Firefox versions
22 ({gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", n ull));
23 }
24 catch(e)
25 {
26 // No developer tools or unsupported version - ignore.
27 return;
28 }
20 } 29 }
21 30
22 gDevTools.on("inspector-ready", this.inspectorReady); 31 gDevTools.on("inspector-ready", this.inspectorReady);
23 onShutdown.add(function() 32 onShutdown.add(function()
24 { 33 {
25 gDevTools.off("inspector-ready", this.inspectorReady); 34 gDevTools.off("inspector-ready", this.inspectorReady);
26 }.bind(this)); 35 }.bind(this));
27 }, 36 },
28 37
29 get inspectorButtonTooltip() 38 get inspectorButtonTooltip()
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 81
73 //Override button style for light DevTools theme 82 //Override button style for light DevTools theme
74 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet ", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); 83 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet ", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"');
75 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); 84 panelWindow.document.insertBefore(style, panelWindow.document.firstChild);
76 85
77 inspectBtn.parentNode.insertBefore(button, inspectBtn); 86 inspectBtn.parentNode.insertBefore(button, inspectBtn);
78 } 87 }
79 }; 88 };
80 89
81 InspectorObserver.init(); 90 InspectorObserver.init();
OLDNEW
« chrome/content/processScript.js ('K') | « chrome/content/processScript.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld