1(function () { 2 'use strict'; 3 4 var loaded = false; 5 6 function runInsertedScripts(container) { 7 container.querySelectorAll('script').forEach(function (oldScript) { 8 var newScript = document.createElement('script'); 9 10 Array.prototype.slice.call(oldScript.attributes).forEach(function (attr) { 11 newScript.setAttribute(attr.name, attr.value); 12 }); 13 14 if (oldScript.textContent) { 15 newScript.textContent = oldScript.textContent; 16 } 17 18 oldScript.parentNode.replaceChild(newScript, oldScript); 19 }); 20 } 21 22 function loadPop() { 23 var slot = document.querySelector('[data-ypb-pop-play]'); 24 var src; 25 26 if (loaded || !slot || !window.fetch) { 27 return; 28 } 29 30 loaded = true; 31 src = slot.getAttribute('data-src') || '/partials/pop-play.php'; 32 33 fetch(src, { 34 credentials: 'same-origin', 35 cache: 'no-store' 36 }) 37 .then(function (response) { 38 if (!response.ok) { 39 throw new Error('Play pop failed'); 40 } 41 return response.text(); 42 }) 43 .then(function (html) { 44 if (!html || !html.trim()) { 45 return; 46 } 47 48 slot.innerHTML = html; 49 runInsertedScripts(slot); 50 slot.setAttribute('data-loaded', '1'); 51 }) 52 .catch(function () { 53 slot.remove(); 54 }); 55 } 56 57 if (document.readyState === 'loading') { 58 document.addEventListener('DOMContentLoaded', loadPop, { once: true }); 59 } else { 60 loadPop(); 61 } 62}());
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.