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

Side by Side Diff: chrome/content/frameScript.js

Issue 29332902: Issue 3443 - Use process script instead of a frame script in Element Hiding Helper (Closed)
Patch Set: Addressed comments Created Dec. 21, 2015, 7:13 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 | « chrome/content/composer.js ('k') | chrome/content/processScript.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
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
4 * http://mozilla.org/MPL/2.0/.
5 */
6
7 (function()
8 {
9 const Cu = Components.utils;
10
11 let rand = Components.stack.filename.replace(/.*\?/, "");
12 let module = "chrome://elemhidehelper/content/actor.jsm?" + rand;
13 let {shutdown, getNodeInfo, togglePreview, forgetNode} = Cu.import(module, {}) ;
14
15 addMessageListener("ElemHideHelper:Shutdown", onShutdown);
16 addMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo);
17 addMessageListener("ElemHideHelper:Preview", onTogglePreview);
18
19 function onShutdown()
20 {
21 shutdown();
22 try
23 {
24 Cu.unload(module);
25 }
26 catch (e)
27 {
28 Cu.reportError(e);
29 }
30
31 removeMessageListener("ElemHideHelper:Shutdown", onShutdown);
32 removeMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo);
33 removeMessageListener("ElemHideHelper:Preview", onTogglePreview);
34 }
35
36 function onGetNodeInfo(message)
37 {
38 let nodeInfo = getNodeInfo(message.objects.element);
39 nodeInfo.messageId = message.data;
40 sendAsyncMessage("ElemHideHelper:GetNodeInfo:Response", nodeInfo);
41 }
42
43 function onTogglePreview(message)
44 {
45 togglePreview(message.data.nodeID, message.data.stylesheetData);
46 if (message.data.forgetNode)
47 forgetNode(message.data.nodeID);
48 }
49 })();
OLDNEW
« no previous file with comments | « chrome/content/composer.js ('k') | chrome/content/processScript.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld