1(function() { 2 const articleEl = document.currentScript.parentNode; 3 const resize = function(iframe) { 4 if(iframe.matches('[id*="google_ads"], [src*="doubleclick.net"], [src*="googlesyndication"], [aria-label="Advertisement"], [srcdoc], [data-contents], .instagram-media')) return; 5 if(iframe.src.startsWith('https://www.facebook.com/') && iframe.src.match(/width=500/)) { 6 iframe.style.width = '100%'; 7 iframe.src = iframe.src.replace(/width=500/, 'width=auto'); 8 console.log('resize iframe(fb)', iframe.outerHTML); 9 10 return; 11 } 12 else if(iframe.matches('[id^="twitter-widget"]')) { 13 iframe.parentNode.style.margin = '0 auto'; 14 return; 15 } 16 17 if(isNaN(iframe.width) || isNaN(iframe.height)) return; 18 19 iframe.style.aspectRatio = `${iframe.width}/${iframe.height}`; 20 iframe.style.width = '100%'; 21 iframe.style.height = 'auto'; 22 console.log('resize iframe', iframe.outerHTML); 23 } 24 const observer = new MutationObserver(function(records) { 25 for (const record of records) { 26 if (record.type !== 'childList' || record.addedNodes.length === 0) continue; 27 28 for(const el of record.addedNodes) { 29 const isIframe = el.nodeName === 'IFRAME'; 30 if(!(isIframe || el.children?.length > 0)) continue; 31 const iframeEl = isIframe ? el : el.querySelector('iframe'); 32 if(iframeEl) resize(iframeEl); 33 } 34 } 35 }); 36 observer.observe(articleEl, { childList: true, subtree: true }); 37})();
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.