PageSourceSearch

https://www.paulroescher.nl/cdn/shop/t/5/assets/youtube-formatter.js?v=181728861167817481141732082760

js paulroescher.nl collected 2026-10-09 02:03:03 UTC 2,273 bytes, 15 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){const config={width:560,height:315,containerClass:"youtube-embed-container",allowFullscreen:!0};function extractVideoId(url){const patterns=[/(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?v=([^&]+)/i,/(?:https?:\/\/)?(?:www\.)?youtu\.be\/([^?]+)/i,/(?:https?:\/\/)?(?:www\.)?youtube\.com\/embed\/([^?]+)/i];for(const pattern of patterns){const match=url.match(pattern);if(match&&match[1])return match[1]}return null}function createEmbed(videoId){const container=document.createElement("div");container.className=config.containerClass,container.style.cssText="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 20px 0;";const iframe=document.createElement("iframe");return iframe.src=`https://www.youtube.com/embed/${videoId}`,iframe.style.cssText="position: absolute; top: 0; left: 0; width: 100%; height: 100%;",iframe.setAttribute("frameborder","0"),iframe.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),config.allowFullscreen&&iframe.setAttribute("allowfullscreen",""),container.appendChild(iframe),container}function processContent(){const walker=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1),nodesToProcess=[];let node;for(;node=walker.nextNode();)node.parentNode.tagName==="SCRIPT"||node.parentNode.tagName==="STYLE"||nodesToProcess.push(node);nodesToProcess.forEach(textNode=>{const lines=textNode.textContent.split(`
2`);let hasYouTubeLink=!1;lines.forEach((line,index)=>{const videoId=extractVideoId(line.trim());if(videoId){hasYouTubeLink=!0,lines[index]="";const embed=createEmbed(videoId);textNode.parentNode.insertBefore(embed,textNode.nextSibling)}}),hasYouTubeLink&&(textNode.textContent=lines.join(`
3`).replace(/\n{3,}/g,`
4
5`))})}const style=document.createElement("style");style.textContent=`
6    .${config.containerClass} {
7      background-color: #f8f8f8;
8      border-radius: 8px;
9      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
10    }
11    .${config.containerClass} iframe {
12      border-radius: 8px;
13    }
14  `,document.head.appendChild(style),processContent()});
15//# sourceMappingURL=/cdn/shop/t/5/assets/youtube-formatter.js.map?v=181728861167817481141732082760

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.