| Index: telemetry/third_party/snap-it/content_script.js
|
| diff --git a/telemetry/third_party/snap-it/content_script.js b/telemetry/third_party/snap-it/content_script.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1abfc1f5bcf61c6adeda10a6df6d49a81b763420
|
| --- /dev/null
|
| +++ b/telemetry/third_party/snap-it/content_script.js
|
| @@ -0,0 +1,31 @@
|
| +/**
|
| + * Send the neccessary HTMLSerializer properties back to the extension.
|
| + *
|
| + * @param {HTMLSerializer} htmlSerializer The HTMLSerializer.
|
| + */
|
| +function sendHTMLSerializerToExtension(htmlSerializer) {
|
| + var result = {
|
| + 'html': htmlSerializer.html,
|
| + 'frameHoles': htmlSerializer.frameHoles,
|
| + 'idToStyleIndex': htmlSerializer.idToStyleIndex,
|
| + 'idToStyleMap': htmlSerializer.idToStyleMap,
|
| + 'windowHeight': htmlSerializer.windowHeight,
|
| + 'windowWidth': htmlSerializer.windowWidth,
|
| + 'rootId': htmlSerializer.rootId,
|
| + 'rootStyleIndex': htmlSerializer.rootStyleIndex,
|
| + 'pseudoElementSelectorToCSSMap':
|
| + htmlSerializer.pseudoElementSelectorToCSSMap,
|
| + 'pseudoElementPlaceHolderIndex':
|
| + htmlSerializer.pseudoElementPlaceHolderIndex,
|
| + 'pseudoElementTestingStyleIndex':
|
| + htmlSerializer.pseudoElementStyleTestingIndex,
|
| + 'pseudoElementTestingStyleId': htmlSerializer.pseudoElementTestingStyleId,
|
| + 'unusedId': htmlSerializer.generateId(document),
|
| + 'frameIndex': htmlSerializer.iframeFullyQualifiedName(window)
|
| + };
|
| + chrome.runtime.sendMessage(result);
|
| +}
|
| +
|
| +var htmlSerializer = new HTMLSerializer();
|
| +htmlSerializer.processDocument(document);
|
| +htmlSerializer.fillHolesAsync(document, sendHTMLSerializerToExtension);
|
|
|