1export class rgData extends HTMLScriptElement { 2 3 constructor() { 4 super(); 5 this.data = new Map(); 6 } 7 8 connectedCallback() { 9 if(!this.childElementCount) { 10 const xmlDoc = new DOMParser().parseFromString(this.textContent, "text/html"); 11 this.textContent = ''; 12 xmlDoc.body.childNodes.forEach(function (node) { 13 this.append(node); 14 }.bind(this)); 15 } 16 const config = { 17 attributes: true, 18 childList: true, 19 subtree: true 20 }; 21 const callback = function(mutationList, observer) { 22 for (const mutation of mutationList) { 23 document.dispatchEvent(new CustomEvent('rgdata:dataChanged', { 24 detail: { 25 el: this, 26 mutation: mutation 27 } 28 })); 29 } 30 }.bind(this); 31 32 const observer = new MutationObserver(callback); 33 observer.observe(this, config); 34 35 document.dispatchEvent(new CustomEvent('rgdata:dataAdded', { 36 detail: {el: this} 37 })); 38 } 39 40 disconnectedCallback() { 41 document.dispatchEvent(new CustomEvent('rgdata:dataDeleted', { 42 detail: {el: this} 43 })); 44 } 45}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.