1function reviLoadWidgetScriptIfNeeded() { 2 if (!document.querySelector('[data-revi-widget-lazy]')) { 3 return; 4 } 5 6 if (window.__reviWidgetLoaderInjected || document.querySelector('script[data-revi-widget-cdn]')) { 7 return; 8 } 9 10 window.__reviWidgetLoaderInjected = true; 11 12 var script = document.createElement('script'); 13 script.src = 'https://widgets.revi.io/embed/widget.js'; 14 script.async = true; 15 script.setAttribute('data-revi-widget-cdn', '1'); 16 script.onerror = function () { 17 window.__reviWidgetLoadFailed = true; 18 }; 19 20 document.head.appendChild(script); 21} 22 23document.addEventListener('DOMContentLoaded', function () { 24 reviLoadWidgetScriptIfNeeded(); 25 26 if (!window.MutationObserver) { 27 return; 28 } 29 30 var observer = new MutationObserver(function (mutations) { 31 for (var i = 0; i < mutations.length; i++) { 32 for (var j = 0; j < mutations[i].addedNodes.length; j++) { 33 var node = mutations[i].addedNodes[j]; 34 if (!node || node.nodeType !== 1) { 35 continue; 36 } 37 38 if ( 39 (node.matches && node.matches('[data-revi-widget-lazy]')) || 40 (node.querySelector && node.querySelector('[data-revi-widget-lazy]')) 41 ) { 42 reviLoadWidgetScriptIfNeeded(); 43 observer.disconnect(); 44 return; 45 } 46 } 47 } 48 }); 49 50 observer.observe(document.documentElement, { 51 childList: true, 52 subtree: true 53 }); 54});
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.