Index: chrome/content/frameScript.js |
=================================================================== |
--- a/chrome/content/frameScript.js |
+++ b/chrome/content/frameScript.js |
@@ -5,27 +5,36 @@ |
*/ |
(function() |
{ |
const Cu = Components.utils; |
let rand = Components.stack.filename.replace(/.*\?/, ""); |
let module = "chrome://elemhidehelper/content/actor.jsm?" + rand; |
- let {shutdown, getNodeInfo} = Cu.import(module, {}); |
+ let {shutdown, getNodeInfo, togglePreview, forgetNode} = Cu.import(module, {}); |
addMessageListener("ElemHideHelper:Shutdown", onShutdown); |
addMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo); |
+ addMessageListener("ElemHideHelper:Preview", onTogglePreview); |
function onShutdown() |
{ |
shutdown(); |
Cu.unload(module); |
removeMessageListener("ElemHideHelper:Shutdown", onShutdown); |
removeMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo); |
+ removeMessageListener("ElemHideHelper:Preview", onTogglePreview); |
} |
function onGetNodeInfo(message) |
{ |
- let info = getNodeInfo(message.objects.element); |
- message.objects.callback(info.nodeData, info.host); |
+ let nodeInfo = getNodeInfo(message.objects.element); |
+ message.objects.callback(JSON.stringify(nodeInfo)); |
Wladimir Palant
2015/07/30 13:13:22
Strictly speaking I am fixing an issue of the prev
|
+ } |
+ |
+ function onTogglePreview(message) |
+ { |
+ togglePreview(message.data.nodeID, message.data.stylesheetData); |
+ if (message.data.forgetNode) |
+ forgetNode(message.data.nodeID); |
} |
})(); |