javascript:(async()=>{const D=document,CE=e=>D.createElement(e),B=D.body,S=CE('style');S.id='pr-style';S.textContent='@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Noto+Sans+JP:wght@400;500&display=swap");#pr-ovly,#pr-msg{position:fixed;inset:0;background:rgba(10,10,15,.85);z-index:999999;display:flex;align-items:center;justify-content:center;font-family:"Noto Sans JP",sans-serif}#pr-msg{cursor:pointer}#pr-mdl{background:#111118;color:#e8e8f0;padding:24px;width:90%;max-width:800px;max-height:90vh;overflow-y:auto;border-radius:16px;border:1px solid #2a2a3a;box-shadow:0 20px 50px rgba(0,0,0,.5);cursor:default}.pr-blk{background:#111118;border:1px solid #2a2a3a;border-radius:12px;margin-bottom:16px;overflow:hidden}.pr-hdr{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#1a1a24;border-bottom:1px solid #2a2a3a;cursor:pointer}.pr-lbl{font-family:"Space Mono",monospace;font-size:12px;font-weight:700;display:flex;align-items:center;gap:8px;user-select:none}.pr-dot{width:8px;height:8px;border-radius:50%}.dot-pos{background:#4fffb0;box-shadow:0 0 6px #4fffb0}.dot-neg{background:#ff6a8a;box-shadow:0 0 6px #ff6a8a}.dot-oth{background:#7c6aff;box-shadow:0 0 6px #7c6aff}.dot-chr{background:#ffcc33;box-shadow:0 0 6px #ffcc33}.pr-txt{padding:16px;font-family:"Space Mono",monospace;font-size:13px;white-space:pre-wrap;word-break:break-all;color:#e8e8f0;border-top:1px solid #2a2a3a}.pr-cpy{background:0 0;border:1px solid #fff;color:#fff;font-family:"Space Mono",monospace;font-size:10px;padding:4px 8px;border-radius:4px;cursor:pointer;transition:.2s}.pr-cpy:hover{background:rgba(255,255,255,.1)}.pr-tgl{font-family:monospace;margin-left:auto;margin-right:12px;color:#6a6a80}#pr-msg-box{background:#111118;color:#ff6a8a;padding:20px 40px;border-radius:12px;border:1px solid #ff6a8a;font-family:"Space Mono",monospace;font-weight:700}';if(!D.getElementById('pr-style'))D.head.appendChild(S);const T8=new TextDecoder('utf-8'),T16=new TextDecoder('utf-16le'),rPNG=async b=>{const v=new DataView(b),c={};let o=8;while(ob.byteLength)break;const l=v.getUint32(o);o+=4;const t=String.fromCharCode(v.getUint8(o),v.getUint8(o+1),v.getUint8(o+2),v.getUint8(o+3));o+=4;if(o+l>b.byteLength||t==='IDAT')break;const d=new Uint8Array(b,o,l);o+=l+4;if(t==='tEXt'||t==='iTXt'||t==='zTXt'){const s=d.indexOf(0);if(s!==-1){const k=T8.decode(d.slice(0,s));let val='';try{if(t==='zTXt'){const ds=new DecompressionStream('deflate'),rb=new Response(new Blob([d.slice(s+2)]).stream().pipeThrough(ds));val=T8.decode(await rb.arrayBuffer())}else val=T8.decode(d.slice(t==='iTXt'?d.lastIndexOf(0)+1:s+1));c[k]=val}catch(e){}}}if(t==='IEND')break}return c},rExif=b=>{const u=new Uint8Array(b),lim=Math.min(u.length-1,131072);let i=0;while(ilim)break;const l=(u[i+2]<<8)|u[i+3],e=u.slice(i+4,i+4+l);if(e.length<4)break;if(T8.decode(e.slice(0,4))==='Exif'){const v=new DataView(e.buffer,e.byteOffset+6,e.byteLength-6),lit=v.getUint16(0)===18761,off=v.getUint32(4,lit),cnt=v.getUint16(off,lit);for(let j=0;j{if(!r)return null;try{const j=JSON.parse(r);if(j.prompt||j.uc)return{p:j.prompt||'',n:j.uc||'',e:JSON.stringify(j,null,2),c:j.v4_prompt?.caption?.char_captions?.map(c=>c.char_caption?.trim()).filter(Boolean)};const ps=[],ns=[],nds=j.nodes||Object.values(j);nds.forEach(n=>{if(n?.class_type==='CLIPTextEncode'){const t=n.inputs?.text||'';if((n._meta?.title||'').toLowerCase().includes('neg'))ns.push(t);else ps.push(t)}});if(ps.length||ns.length)return{p:ps.join('\n'),n:ns.join('\n'),e:'ComfyUI Workflow'};return{e:JSON.stringify(j,null,2)}}catch(e){}const nm=r.match(/\nNegative prompt:\s*/i),sm=r.match(/\n(Steps|Sampler|CFG|Seed|Size|Model)[:s]/i);let p='',n='',ex='';if(nm){p=r.slice(0,nm.index).trim();const an=r.slice(nm.index+nm[0].length);if(sm){const si=an.search(/\n(Steps|Sampler|CFG|Seed|Size|Model)[:s]/i);if(si>=0){n=an.slice(0,si).trim();ex=an.slice(si).trim()}else n=an.trim()}else n=an.trim()}else if(sm){const si=r.search(/\n(Steps|Sampler|CFG|Seed|Size|Model)[:s]/i);p=r.slice(0,si).trim();ex=r.slice(si).trim()}else p=r.trim();return{p,n,e:ex}},mB=(l,t,tp)=>{const b=CE('div'),col=tp==='pos'?'#4fffb0':tp==='neg'?'#ff6a8a':tp==='chr'?'#ffcc33':'#7c6aff';b.className='pr-blk';b.innerHTML='
'+l+'
'+(tp==='oth'?'[ + ]':'[ - ]')+'
';const txt=b.querySelector('.pr-txt'),tgl=b.querySelector('.pr-tgl');txt.textContent=t;if(tp==='oth')txt.style.display='none';b.querySelector('.pr-hdr').onclick=e=>{if(e.target.classList.contains('pr-cpy'))return;const h=txt.style.display==='none';txt.style.display=h?'block':'none';tgl.textContent=h?'[ - ]':'[ + ]'};b.querySelector('.pr-cpy').onclick=e=>{e.stopPropagation();navigator.clipboard.writeText(t);e.target.textContent='DONE';setTimeout(()=>e.target.textContent='COPY',1500)};return b},pop=res=>{const o=CE('div'),m=CE('div');o.id='pr-ovly';m.id='pr-mdl';if(res.c?.length)res.c.forEach((t,i)=>m.appendChild(mB('CHAR '+(i+1),t,'chr')));if(res.p)m.appendChild(mB('POSITIVE PROMPT',res.p,'pos'));if(res.n)m.appendChild(mB('NEGATIVE PROMPT',res.n,'neg'));if(res.e)m.appendChild(mB('GENERATION INFO',res.e,'oth'));o.onclick=()=>o.remove();m.onclick=e=>e.stopPropagation();B.appendChild(o).appendChild(m)},msg=t=>{const o=CE('div');o.id='pr-msg';o.innerHTML='
'+t+'
';o.onclick=()=>o.remove();B.appendChild(o);setTimeout(()=>{if(B.contains(o))o.remove()},1000)},chk=async u=>{try{const req=await fetch(u,{headers:{Range:'bytes=0-131072'}});if(!req.ok&&req.status!==206&&req.status!==200)return null;const ab=await req.arrayBuffer(),c=await rPNG(ab),raw=c.parameters||c.Comment||Object.values(c)[0]||rExif(ab),res=pP(raw);if(res?.p||res?.n||res?.e)return res}catch(e){}return null},q=[],lim=4;let act=0;const runQ=async()=>{if(act>=lim||q.length===0)return;act++;const t=q.shift();await t();act--;runQ()},enq=t=>{q.push(t);runQ()},reI=/\.(png|jpg|webp)$/i,isD=reI.test(location.href)||D.contentType?.startsWith('image/')||(B?.children.length===1&&B.firstElementChild?.tagName==='IMG');if(isD){const res=await chk(location.href);res?pop(res):msg('メタデータ無し');return}const dU=new Set(),scn=()=>{D.querySelectorAll('a').forEach(t=>{if(!t.dataset.pr&&reI.test(t.href)&&t.href.includes('/b/src/')){if(dU.has(t.href))return;dU.add(t.href);t.dataset.pr=1;enq(async()=>{const res=await chk(t.href);if(res){const b=CE('button');b.innerText='Info';b.style.cssText='display:inline-block;margin-left:8px;vertical-align:middle;cursor:pointer;padding:2px 8px;font-size:12px;border-radius:4px;border:1px solid #ccc;background:#fff;color:#000;font-family:monospace;font-weight:bold;';b.onclick=ev=>{ev.preventDefault();ev.stopPropagation();pop(res)};t.after(b)}})}})};scn();let tm;window.addEventListener('scroll',()=>{if(tm)clearTimeout(tm);tm=setTimeout(()=>{if(window.innerHeight+window.scrollY>=D.documentElement.scrollHeight-500)scn()},200)})})(); 1. 導入方法(初回のみ) Step 1: ブラウザのブックマーク(お気に入り)バーを表示します。 Step 2: 適当なページをブックマークし、名前を分かりやすいもの(例: 「画像解析」)に変更します。 Step 3: ブックマークの編集画面を開き、「URL」欄の中身をすべて消去して、作成したプログラム文字列(上記)を貼り付けて保存します。 2. 使い方①:スレッド一覧画面での一括スキャン 画像リンクが多数存在するスレッドを閲覧している際の基本的な使い方です。 起動: スレッドを開いた状態で、登録したブックマークレットをクリックします。 自動判定: 画面内の画像リンクがバックグラウンドで高速スキャンされます。 🟢 [ Info ] ボタン出現: AIメタデータが確認できた画像のリンク末尾にのみ表示されます。 🔴 変化なし: メタデータが無い画像には何も表示されず、画面が散らかるのを防ぎます。 スクロール連動: ページを下へスクロールすると、新しく画面に入ってきた画像リンクも自動的に追加スキャンされます。 3. 使い方②:画像単体(直接閲覧)モード 画像を直接開いている状態での使い方です。 起動: 画像のURL(.png など)を直接開いているページ、または画像が1枚だけ表示されているページでブックマークレットをクリックします。 即時表示: メタデータが存在する場合は、ボタンを経由せずに即座に解析画面がポップアップします。データが無い場合は、画面上部に小さく「メタデータ無し」と通知が出ます。 4. 解析結果画面(ポップアップ)の機能 対象の画像から抽出されたデータは、見やすいダークテーマの画面で表示されます。 情報の分類表示 🟢 POSITIVE PROMPT: 画像生成に使われたメインの呪文です。 🔴 NEGATIVE PROMPT: 除外指定された呪文です。 🟣 GENERATION INFO: シード値、サンプラー、ステップ数などの詳細な生成パラメータです。 🟡 CHAR: キャラクター指定のタグが含まれていた場合に表示されます。 折りたたみ(トグル)機能 各ブロックの右上にある [ - ] や [ + ] をクリックすると、長いテキストを折りたたんで隠すことができます。 ワンクリックコピー 各ブロックの右上にある [ COPY ] ボタンを押すと、その項目のテキストだけをクリップボードにコピーできます(成功すると [ DONE ] に変わります)。 画面の閉じ方 ポップアップ外の暗い背景部分(余白)をクリックすると、一瞬で元の画面に戻ります。