Tests that DOMSnapshot.getSnapshot records origin url of dom nodes generated by script. { computedStyles : [ ] domNodes : [ [0] : { backendNodeId : baseURL : childNodeIndexes : [ [0] : 1 ] documentEncoding : windows-1252 documentURL : frameId : layoutNodeIndex : 0 nodeName : #document nodeType : 9 nodeValue : scrollOffsetX : 0 scrollOffsetY : 0 } [1] : { backendNodeId : childNodeIndexes : [ [0] : 2 [1] : 3 ] frameId : layoutNodeIndex : 1 nodeName : HTML nodeType : 1 nodeValue : } [2] : { backendNodeId : nodeName : HEAD nodeType : 1 nodeValue : } [3] : { backendNodeId : childNodeIndexes : [ [0] : 4 [1] : 5 [2] : 7 [3] : 8 [4] : 10 [5] : 11 [6] : 12 [7] : 13 [8] : 25 [9] : 26 [10] : 28 [11] : 29 [12] : 31 [13] : 32 [14] : 34 [15] : 35 [16] : 39 [17] : 40 [18] : 43 [19] : 44 [20] : 46 [21] : 47 [22] : 49 ] layoutNodeIndex : 2 nodeName : BODY nodeType : 1 nodeValue : } [4] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [5] : { backendNodeId : childNodeIndexes : [ [0] : 6 ] nodeName : SCRIPT nodeType : 1 nodeValue : } [6] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : function createImage() { let img = new Image(0, 0); let sibling = document.getElementById('firstChild'); sibling.parentNode.insertBefore(img, sibling); } //# sourceURL=inspector-dom-origin-url-1.js } [7] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [8] : { backendNodeId : childNodeIndexes : [ [0] : 9 ] nodeName : SCRIPT nodeType : 1 nodeValue : } [9] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : let firstChild = document.body.appendChild(document.createElement('span')); firstChild.setAttribute('id', 'firstChild'); createImage(); } [10] : { attributes : [ [0] : { name : width value : 0 } [1] : { name : height value : 0 } ] backendNodeId : currentSourceURL : layoutNodeIndex : 3 nodeName : IMG nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-1.js } [11] : { attributes : [ [0] : { name : id value : firstChild } ] backendNodeId : layoutNodeIndex : 4 nodeName : SPAN nodeType : 1 nodeValue : originURL : } [12] : { backendNodeId : layoutNodeIndex : 5 nodeName : #text nodeType : 3 nodeValue : } [13] : { attributes : [ [0] : { name : name value : testWrite } ] backendNodeId : contentDocumentIndex : 14 frameId : layoutNodeIndex : 6 nodeName : IFRAME nodeType : 1 nodeValue : } [14] : { backendNodeId : baseURL : childNodeIndexes : [ [0] : 15 ] documentEncoding : UTF-8 documentURL : frameId : layoutNodeIndex : 7 nodeName : #document nodeType : 9 nodeValue : scrollOffsetX : 0 scrollOffsetY : 0 } [15] : { backendNodeId : childNodeIndexes : [ [0] : 16 [1] : 17 ] frameId : layoutNodeIndex : 8 nodeName : HTML nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-2.js } [16] : { backendNodeId : nodeName : HEAD nodeType : 1 nodeValue : } [17] : { backendNodeId : childNodeIndexes : [ [0] : 18 [1] : 20 [2] : 23 ] layoutNodeIndex : 9 nodeName : BODY nodeType : 1 nodeValue : } [18] : { backendNodeId : childNodeIndexes : [ [0] : 19 ] layoutNodeIndex : 10 nodeName : P nodeType : 1 nodeValue : } [19] : { backendNodeId : layoutNodeIndex : 11 nodeName : #text nodeType : 3 nodeValue : Top html node has an origin url. } [20] : { backendNodeId : childNodeIndexes : [ [0] : 21 ] layoutNodeIndex : 12 nodeName : SPAN nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-3.js } [21] : { backendNodeId : childNodeIndexes : [ [0] : 22 ] layoutNodeIndex : 13 nodeName : P nodeType : 1 nodeValue : } [22] : { backendNodeId : layoutNodeIndex : 14 nodeName : #text nodeType : 3 nodeValue : Only top node has an origin url. } [23] : { backendNodeId : childNodeIndexes : [ [0] : 24 ] layoutNodeIndex : 15 nodeName : P nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-3.js } [24] : { backendNodeId : layoutNodeIndex : 16 nodeName : #text nodeType : 3 nodeValue : And sibling top node. } [25] : { backendNodeId : layoutNodeIndex : 17 nodeName : #text nodeType : 3 nodeValue : } [26] : { attributes : [ [0] : { name : id value : testInnerText } ] backendNodeId : childNodeIndexes : [ [0] : 27 ] layoutNodeIndex : 18 nodeName : SPAN nodeType : 1 nodeValue : } [27] : { backendNodeId : layoutNodeIndex : 19 nodeName : #text nodeType : 3 nodeValue : New content. originURL : inspector-dom-origin-url-3.js } [28] : { backendNodeId : layoutNodeIndex : 20 nodeName : #text nodeType : 3 nodeValue : } [29] : { attributes : [ [0] : { name : id value : testInnerHtml1 } ] backendNodeId : childNodeIndexes : [ [0] : 30 ] layoutNodeIndex : 21 nodeName : DIV nodeType : 1 nodeValue : } [30] : { backendNodeId : layoutNodeIndex : 22 nodeName : #text nodeType : 3 nodeValue : Hello originURL : } [31] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [32] : { backendNodeId : childNodeIndexes : [ [0] : 33 ] nodeName : SCRIPT nodeType : 1 nodeValue : } [33] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : document.getElementById('testInnerHtml1').innerHTML = 'Hello'; } [34] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [35] : { attributes : [ [0] : { name : id value : testInnerHtml2 } ] backendNodeId : childNodeIndexes : [ [0] : 36 ] layoutNodeIndex : 23 nodeName : SPAN nodeType : 1 nodeValue : } [36] : { backendNodeId : childNodeIndexes : [ [0] : 37 ] layoutNodeIndex : 24 nodeName : P nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-3.js } [37] : { backendNodeId : childNodeIndexes : [ [0] : 38 ] layoutNodeIndex : 25 nodeName : SPAN nodeType : 1 nodeValue : } [38] : { backendNodeId : layoutNodeIndex : 26 nodeName : #text nodeType : 3 nodeValue : Inner World } [39] : { backendNodeId : layoutNodeIndex : 27 nodeName : #text nodeType : 3 nodeValue : } [40] : { backendNodeId : childNodeIndexes : [ [0] : 41 ] layoutNodeIndex : 28 nodeName : P nodeType : 1 nodeValue : originURL : inspector-dom-origin-url-3.js } [41] : { backendNodeId : childNodeIndexes : [ [0] : 42 ] layoutNodeIndex : 29 nodeName : SPAN nodeType : 1 nodeValue : } [42] : { backendNodeId : layoutNodeIndex : 30 nodeName : #text nodeType : 3 nodeValue : Outer World } [43] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [44] : { backendNodeId : childNodeIndexes : [ [0] : 45 ] nodeName : SCRIPT nodeType : 1 nodeValue : } [45] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : testWrite.document.write('

Top html node has an origin url.

'); //# sourceURL=inspector-dom-origin-url-2.js } [46] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } [47] : { backendNodeId : childNodeIndexes : [ [0] : 48 ] nodeName : SCRIPT nodeType : 1 nodeValue : } [48] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : testWrite.document.write('

Only top node has an origin url.

And sibling top node.

'); testWrite.document.close(); document.getElementById('testInnerText').innerText = 'New content.'; eval("document.getElementById('testInnerHtml2').innerHTML = '

Inner World

'"); document.getElementById('testOuterHtml').outerHTML = '

Outer World

'; //# sourceURL=inspector-dom-origin-url-3.js } [49] : { backendNodeId : nodeName : #text nodeType : 3 nodeValue : } ] layoutTreeNodes : }