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

Unified Diff: lib/child/commands.js

Issue 29402624: Issue 5097, issue 5099 - Only retrieve element source from the process actually selecting (Closed) Base URL: https://hg.adblockplus.org/elemhidehelper/
Patch Set: Created April 4, 2017, 6 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/child/commands.js
===================================================================
--- a/lib/child/commands.js
+++ b/lib/child/commands.js
@@ -62,24 +62,30 @@ function serializeNode(node)
};
break;
}
return result;
}
function serializeSelected(message)
{
+ if (!state.selectedElement)
+ return;
+
messageManager.sendAsyncMessage("ElemHideHelper:Response", {
messageId: message.data.messageId,
serialized: serializeNode(state.selectedElement)
});
}
function getHTML(message)
{
+ if (!state.selectedElement)
+ return;
+
messageManager.sendAsyncMessage("ElemHideHelper:Response", {
messageId: message.data.messageId,
html: state.selectedElement.outerHTML,
baseURI: state.selectedElement.baseURI
});
}
function quit()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld