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

Side by Side Diff: lib/main.js

Issue 5201912261509120: issue #390 - remove already integrated parts From EHH (Closed)
Patch Set: Created July 18, 2014, 11:17 a.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 | « lib/inspectorObserver.js ('k') | 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 Cu.import("resource://gre/modules/Services.jsm"); 7 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSX MLHttpRequest); 55 request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSX MLHttpRequest);
56 request.open("GET", "chrome://elemhidehelper/content/overlay.xul"); 56 request.open("GET", "chrome://elemhidehelper/content/overlay.xul");
57 request.addEventListener("load", function(event) 57 request.addEventListener("load", function(event)
58 { 58 {
59 if (onShutdown.done) 59 if (onShutdown.done)
60 return; 60 return;
61 61
62 let overlay = event.target.responseXML.documentElement; 62 let overlay = event.target.responseXML.documentElement;
63 63
64 // Initialization done, we can start up now 64 // Initialization done, we can start up now
65 require("inspectorObserver");
66 new WindowObserver({ 65 new WindowObserver({
67 applyToWindow: function(window) 66 applyToWindow: function(window)
68 { 67 {
69 let type = window.document.documentElement.getAttribute("windowtype"); 68 let type = window.document.documentElement.getAttribute("windowtype");
70 if (!(type in knownWindowTypes) || window._ehhWrapper) 69 if (!(type in knownWindowTypes) || window._ehhWrapper)
71 return; 70 return;
72 71
73 window.document.documentElement.appendChild(overlay.cloneNode(true)); 72 window.document.documentElement.appendChild(overlay.cloneNode(true));
74 73
75 let style = window.document.createProcessingInstruction("xml-stylesheet", 'class="elemhidehelper-node" href="chrome://elemhidehelper/skin/overlay.css" typ e="text/css"'); 74 let style = window.document.createProcessingInstruction("xml-stylesheet", 'class="elemhidehelper-node" href="chrome://elemhidehelper/skin/overlay.css" typ e="text/css"');
(...skipping 14 matching lines...) Expand all
90 if (element) 89 if (element)
91 element.parentNode.removeChild(element); 90 element.parentNode.removeChild(element);
92 91
93 for (let child = window.document.firstChild; child; child = child.nextSibl ing) 92 for (let child = window.document.firstChild; child; child = child.nextSibl ing)
94 if (child.nodeType == child.PROCESSING_INSTRUCTION_NODE && child.data.in dexOf("elemhidehelper-node") >= 0) 93 if (child.nodeType == child.PROCESSING_INSTRUCTION_NODE && child.data.in dexOf("elemhidehelper-node") >= 0)
95 child.parentNode.removeChild(child); 94 child.parentNode.removeChild(child);
96 } 95 }
97 }); 96 });
98 }, false); 97 }, false);
99 request.send(null); 98 request.send(null);
OLDNEW
« no previous file with comments | « lib/inspectorObserver.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld