1document.addEventListener("DOMContentLoaded", () => { 2 const notebookIframes = document.querySelectorAll(".jupyter-notebook-iframe-container iframe"); 3 4 const updateNotebookLinks = (iframe) => { 5 try { 6 const iframeDocument = iframe.contentDocument || iframe.contentWindow?.document; 7 if (!iframeDocument || !iframeDocument.body) { 8 return; 9 } 10 11 iframeDocument.querySelectorAll("a[href]").forEach((link) => { 12 link.setAttribute("target", "_blank"); 13 const currentRel = link.getAttribute("rel") || ""; 14 const relParts = currentRel.split(/\s+/).filter(Boolean); 15 if (!relParts.includes("noopener")) { 16 relParts.push("noopener"); 17 } 18 if (!relParts.includes("noreferrer")) { 19 relParts.push("noreferrer"); 20 } 21 link.setAttribute("rel", relParts.join(" ")); 22 }); 23 } catch (_error) { 24 // Cross-origin iframe access is blocked by design. 25 } 26 }; 27 28 notebookIframes.forEach((iframe) => { 29 if (iframe.contentDocument?.readyState === "complete") { 30 updateNotebookLinks(iframe); 31 } 32 33 iframe.addEventListener("load", () => updateNotebookLinks(iframe)); 34 }); 35});
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.