2
Does anyone know how to communicate an extension created for CHROME with DELPHI ?
Something like sending DELPHI commands to that extension OR vice versa ?
Follow the extension code that captures the CURRENT TAB code.
function DOMtoString(document_root) {
var html = '',
node = document_root.firstChild;
while (node) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
html += node.outerHTML;
break;
case Node.TEXT_NODE:
html += node.nodeValue;
break;
case Node.CDATA_SECTION_NODE:
html += '<![CDATA[' + node.nodeValue + ']]>';
break;
case Node.COMMENT_NODE:
html += '<!--' + node.nodeValue + '-->';
break;
case Node.DOCUMENT_TYPE_NODE:
// (X)HTML documents are identified by public identifiers
html += "<!DOCTYPE " + node.name + (node.publicId ? ' PUBLIC "' + node.publicId + '"' : '') + (!node.publicId && node.systemId ? ' SYSTEM' : '') + (node.systemId ? ' "' + node.systemId + '"' : '') + '>\n';
break;
}
node = node.nextSibling;
}
return html;
}
chrome.extension.sendMessage({
action: "getSource",
source: DOMtoString(document)
});
Explain it better. Is it an external server written in Delphi? It’s a program running on the client machine at the same time as Chrome?
– Guilherme Bernal
I created an extension for CHROME that captures the browser source code in REAL TIME, through a JAVASCRIPT function. Now I need to make DELPHI take this function and play in a MEMO or something related, I don’t know if you can do this, more if you give, the interest of the project would be this.
– user7605
I put the code above Amigo..
– user7605