Created
February 5, 2025 14:30
-
-
Save deadflowers/f329072fa8e0e3983e0c2dfabeed5303 to your computer and use it in GitHub Desktop.
Chrome home - bookmarklet hack Chrome mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){const e=document.getElementById("file-reference-overlay");e&&e.remove();const t=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{e.href&&t.push({type:"CSS",path:e.href,code:`<link rel="stylesheet" href="${e.href}">`})}),document.querySelectorAll("script").forEach(e=>{e.src&&t.push({type:"JavaScript",path:e.src,code:`<script src="${e.src}"></script>`})}),document.querySelectorAll('link[rel="preload"][as="font"]').forEach(e=>{e.href&&t.push({type:"Font",path:e.href,code:`<link rel="stylesheet" href="${e.href}">`})});const n=document.createElement("div");n.id="file-reference-overlay",n.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.95);backdrop-filter:blur(10px);z-index:9999;overflow-y:scroll;padding:20px;box-sizing:border-box";const o=document.createElement("button");o.textContent="Close",o.style.cssText="position:fixed;top:20px;right:20px;padding:10px 20px;font-size:16px;cursor:pointer",o.onclick=()=>n.remove(),n.appendChild(o);const c=document.createElement("button");c.textContent="Download as Text",c.style.cssText="position:fixed;top:20px;left:20px;padding:10px 20px;font-size:16px;cursor:pointer",c.onclick=(()=>{const e=t.map(e=>`${e.type}: ${e.path}\n${e.code}\n\n`).join(""),n=new Blob([e],{type:"text/plain"}),o=document.createElement("a");o.href=URL.createObjectURL(n),o.download="file-references.txt",o.click()}),n.appendChild(c);const a=document.createElement("div");a.style.cssText="padding:20px;background:rgba(255,255,255,0.9);border-radius:10px;max-width:800px;margin:40px auto;box-shadow:0 0 15px rgba(0,0,0,0.2)";const d=document.createElement("h2");d.textContent="File References",d.style.textAlign="center",a.appendChild(d);const l=document.createElement("table");l.style.cssText="width:100%;border-collapse:collapse";const i=document.createElement("thead");i.innerHTML='<tr><th style="border: 1px solid #ccc;%20padding:%208px;%20background-color:%20#f2f2f2;%22%3EType%3C/th%3E%3Cth%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20background-color:%20#f2f2f2;%22%3EPath%3C/th%3E%3Cth%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20background-color:%20#f2f2f2;%22%3EOpen%20File%3C/th%3E%3Cth%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20background-color:%20#f2f2f2;%22%3ECopy%20Block%3C/th%3E%3C/tr%3E',l.appendChild(i);const%20s=document.createElement(%22tbody%22);t.forEach((e,n=%3E{const%20o=document.createElement(%22tr%22);o.innerHTML=%60%3Ctd%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%22%3E${e.type}%3C/td%3E%3Ctd%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20word-break:%20break-all;%22%3E${e.path}%3C/td%3E%3Ctd%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20text-align:%20center;%22%3E%3Cbutton%20data-id=%22${n}%22%20style=%22padding:%205px%2010px;%20cursor:%20pointer;%22%3EOpen%3C/button%3E%3C/td%3E%3Ctd%20style=%22border:%201px%20solid%20#ccc;%20padding:%208px;%20text-align:%20center;%22%3E%3Cbutton%20data-id=%22${n}%22%20style=%22padding:%205px%2010px;%20cursor:%20pointer;%22%3ECopy%20Block%3C/button%3E%3C/td%3E%60,s.appendChild(o)})),l.appendChild(s),a.appendChild(l),n.appendChild(a),document.body.appendChild(n),document.querySelectorAll(%22button[data-id]%22).forEach(e=%3E{e.addEventListener(%22click%22,(e=%3E{const%20n=parseInt(e.target.getAttribute(%22data-id%22)),o=t[n];%22Open%22===e.target.textContent?window.open(o.path):%22Copy%20Block%22===e.target.textContent&&(function(e){const%20t=document.createElement(%22textarea%22);t.value=e,document.body.appendChild(t),t.select(),document.execCommand(%22copy%22),document.body.removeChild(t)}(o.code),alert(%22Code%20block%20copied%20to%20clipboard!%22))}))})})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment