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

Side by Side Diff: lib/main.js

Issue 29330776: Issue 3348 - Element Hiding Helper UI broken after bug 1182546 landing (Closed)
Patch Set: Created Nov. 25, 2015, 12: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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); 7 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
8 8
9 let {Prefs} = require("prefs"); 9 let {Prefs} = require("prefs");
10 let {WindowObserver} = require("windowObserver"); 10 let {WindowObserver} = require("windowObserver");
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 .getService(Ci.nsIFrameScriptLoader); 52 .getService(Ci.nsIFrameScriptLoader);
53 messageManager.loadFrameScript(frameScript, true); 53 messageManager.loadFrameScript(frameScript, true);
54 onShutdown.add(() => { 54 onShutdown.add(() => {
55 messageManager.removeDelayedFrameScript(frameScript); 55 messageManager.removeDelayedFrameScript(frameScript);
56 messageManager.QueryInterface(Ci.nsIMessageBroadcaster).broadcastAsyncMessage( "ElemHideHelper:Shutdown"); 56 messageManager.QueryInterface(Ci.nsIMessageBroadcaster).broadcastAsyncMessage( "ElemHideHelper:Shutdown");
57 }); 57 });
58 58
59 // Load overlay asynchonously and start attaching to windows once done 59 // Load overlay asynchonously and start attaching to windows once done
60 request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSX MLHttpRequest); 60 request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSX MLHttpRequest);
61 request.open("GET", "chrome://elemhidehelper/content/overlay.xul"); 61 request.open("GET", "chrome://elemhidehelper/content/overlay.xul");
62 request.channel.owner = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPr incipal);
62 request.addEventListener("load", function(event) 63 request.addEventListener("load", function(event)
63 { 64 {
64 if (onShutdown.done) 65 if (onShutdown.done)
65 return; 66 return;
66 67
67 let overlay = event.target.responseXML.documentElement; 68 let overlay = event.target.responseXML.documentElement;
68 69
69 // Initialization done, we can start up now 70 // Initialization done, we can start up now
70 require("inspectorObserver"); 71 require("inspectorObserver");
71 new WindowObserver({ 72 new WindowObserver({
(...skipping 23 matching lines...) Expand all
95 if (element) 96 if (element)
96 element.parentNode.removeChild(element); 97 element.parentNode.removeChild(element);
97 98
98 for (let child = window.document.firstChild; child; child = child.nextSibl ing) 99 for (let child = window.document.firstChild; child; child = child.nextSibl ing)
99 if (child.nodeType == child.PROCESSING_INSTRUCTION_NODE && child.data.in dexOf("elemhidehelper-node") >= 0) 100 if (child.nodeType == child.PROCESSING_INSTRUCTION_NODE && child.data.in dexOf("elemhidehelper-node") >= 0)
100 child.parentNode.removeChild(child); 101 child.parentNode.removeChild(child);
101 } 102 }
102 }); 103 });
103 }, false); 104 }, false);
104 request.send(null); 105 request.send(null);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld