OLD | NEW |
1 /** | 1 /** |
2 * Send the neccessary HTMLSerializer properties back to the extension. | 2 * Send the neccessary HTMLSerializer properties back to the extension. |
3 * | 3 * |
4 * @param {HTMLSerializer} htmlSerializer The HTMLSerializer. | 4 * @param {HTMLSerializer} htmlSerializer The HTMLSerializer. |
5 */ | 5 */ |
6 function sendHTMLSerializerToExtension(htmlSerializer) { | 6 function sendHTMLSerializerToExtension(htmlSerializer) { |
7 var result = { | 7 chrome.runtime.sendMessage(htmlSerializer.asDict()); |
8 'html': htmlSerializer.html, | |
9 'frameHoles': htmlSerializer.frameHoles, | |
10 'idToStyleIndex': htmlSerializer.idToStyleIndex, | |
11 'idToStyleMap': htmlSerializer.idToStyleMap, | |
12 'windowHeight': htmlSerializer.windowHeight, | |
13 'windowWidth': htmlSerializer.windowWidth, | |
14 'rootId': htmlSerializer.rootId, | |
15 'rootStyleIndex': htmlSerializer.rootStyleIndex, | |
16 'pseudoElementSelectorToCSSMap': | |
17 htmlSerializer.pseudoElementSelectorToCSSMap, | |
18 'pseudoElementPlaceHolderIndex': | |
19 htmlSerializer.pseudoElementPlaceHolderIndex, | |
20 'pseudoElementTestingStyleIndex': | |
21 htmlSerializer.pseudoElementStyleTestingIndex, | |
22 'pseudoElementTestingStyleId': htmlSerializer.pseudoElementTestingStyleId, | |
23 'unusedId': htmlSerializer.generateId(document), | |
24 'frameIndex': htmlSerializer.iframeFullyQualifiedName(window) | |
25 }; | |
26 chrome.runtime.sendMessage(result); | |
27 } | 8 } |
28 | 9 |
29 var htmlSerializer = new HTMLSerializer(); | 10 var htmlSerializer = new HTMLSerializer(); |
30 htmlSerializer.processDocument(document); | 11 htmlSerializer.processDocument(document); |
31 htmlSerializer.fillHolesAsync(document, sendHTMLSerializerToExtension); | 12 htmlSerializer.fillHolesAsync(document, sendHTMLSerializerToExtension); |
OLD | NEW |