这是一个创建于 57 天前的主题,其中的信息可能已经有所发展或是发生改变。
使用 chrome 浏览器新建标签
网址使用下面的代码:
Javascript:(function(){const showToast=(msg,color)=>{let t=document.createElement('div');t.textCOntent=msg;t.style.cssText='position:fixed; top:20px; right:20px; background:#333; color:#fff; padding:8px 16px; border-radius:4px; font-size:14px; z-index:999999; opacity:0; transition:opacity 0.3s;';document.body.appendChild(t);setTimeout(()=>t.style.opacity='1',10);setTimeout(()=>{t.style.opacity='0';setTimeout(()=>document.body.removeChild(t),300);},2000);};const copyText=t=>{let n=document.createElement('input');n.setAttribute('value',t);document.body.appendChild(n);n.select();document.execCommand('copy');document.body.removeChild(n);showToast(' 颜色已复制: '+t);console.log('颜色已通过传统方式复制:',t);};if('EyeDropper'in window){new window.EyeDropper().open().then(async r=>{let c=r.sRGBHex;try{await navigator.clipboard.writeText(c);showToast(' 颜色已复制: '+c);console.log('颜色已复制:',c);}catch(e){console.warn('Clipboard API 失败,尝试传统复制方式');copyText(c);}}).catch(e=>console.log('取色取消或失败:',e));}else{console.warn('浏览器不支持 EyeDropper API ,请使用 Chrome/Edge 95+');}})();
9 条回复 2026-02-27 14:51:12 +08:00  | | 1 cryptovae 2 月 26 日 chrome `Javascript:` 不让粘贴,有点意思 |
 | | 9 lxhcool 2 月 27 日 可以,我直接让 ai 给我写成一个扩展了 |