EDIT

お気に入りブックマークレット集 (随時追加)

2023/09/22
アイキャッチ

私が普段愛用しているブックマークレットを紹介します。よかったら使ってみてね。

ネットでの拾い物を少しだけ自力で改造しています。Chrome, Edge, Firefox で動作確認済みですが、それら以外のブラウザでの動作保証は出来ませんのであしからず。

利用方法

ブックマークレット をブックマークバー(お気に入りバー)などにドラッグ&ドロップして登録してください。ボタンをそのままクリックすると当ページでのテスト結果を確認できます。名前はお好みで適宜変更してください。

ドラッグ&ドロップ 出来ない場合は、適当なページのブックマークを作成して URL 欄に JavaScript コードを上書きしてください。

閲覧中のページをシェア

私は基本的に Twitter と はてブ しか使いませんが、Facebook もついでに置いときます(アカウントが無いためちゃんとシェアできるかはわかりませんw)。

当ブログのシェボタンと同じく画面中央にポップアップウィンドウが表示されます。

ところで今更気づいたのですが、以前紹介したJS版のオリジナルのシェアボタン、わざわざJS使って面倒なことしなくてもこうやって a タグで囲えば簡単に実装出来たんですねw 同じボタンが何個あっても全部問題なく機能します。あれ、ブックマークレットのコードが元になってるのに何で気づかなかったんだろ(~_~;)

X(Twitter)

ツイートボタンがないサイトで使う用ですが、あってもツイート内容が URL だけとか、書式が不満だったりすることが結構あるので。

「ページタイトル URL」がツイートされます。

Xでポスト

javascript:(function(){const w=550,h=420;window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(location.href)+"&text="+encodeURIComponent(document.title),"_blank","width="+w+",height="+h+",left="+(screen.width-w)/2+",top="+(screen.height-h)/2+",scrollbars=yes,resizable=yes,toolbar=no,location=yes")})()

はてなブックマーク

はてなブックマークに追加

javascript:(function(){const w=550,h=420;window.open("https://b.hatena.ne.jp/entry/panel/?url="+encodeURIComponent(location.href)+"&text="+encodeURIComponent(document.title),"_blank","width="+w+",height="+h+",left="+(screen.width-w)/2+",top="+(screen.height-h)/2+",scrollbars=yes,resizable=yes,toolbar=no,location=yes")})()

Facebook

Facebookでシェア

javascript:(function(){const w=550,h=420;window.open("https://www.facebook.com/sharer.php?u="+encodeURIComponent(location.href),"_blank","width="+w+",height="+h+",left="+(screen.width-w)/2+",top="+(screen.height-h)/2+",scrollbars=yes,resizable=yes,toolbar=no,location=yes")})()

2023/09/12 追加: ページタイトルと URL をクリップボードにコピー

その他の SNS でシエアする時用に。

タイトル/URLをコピー

javascript:(function(){navigator.clipboard.writeText(`${document.title}\n${location.href}`).then(function(){alert('コピーしました!')},function(){alert('エラー\nコピーできませんでした。\nアドレスバーからフォーカスを外して、ページ表示部分をアクティブにして下さい。')})})();

参考: 【Javascript】Markdown形式のウェブページのリンクを、ブックマークレットで取得する - Qiita

2023/09/21 追加: リンクを作成

上記のタイトル/URLコピーコードを応用して、閲覧中ページのリンクタグを生成するコードを作りました。(ちなみに自分は Create Link という拡張機能を使っているので、このブックマークレットは使いませんw)

例えば本ページで実行すると、この様なaタグが生成されてクリップボードにコピーされます。

<a href="https://fujilogic.blogspot.com/2022/02/my-favorite-bookmarklet.html">お気に入りブックマークレット集 (随時追加) | ふじろじっく</a>

これを記事編集(HTMLビュー)やコメント投稿で貼り付けるとこうなります。 → お気に入りブックマークレット集 (随時追加) | ふじろじっく

① 同一タブで開くリンク

リンクを作成
javascript:(function(){navigator.clipboard.writeText(`<a href="${location.href}">${document.title}</a>`).then(function(){alert('リンクを作成しました!')},function(){alert('エラー\n作成できませんでした。\nアドレスバーからフォーカスを外して、ページ表示部分をアクティブにして下さい。')})})();

② 新しいタブで開くリンク

リンクを作成(別タブ)
javascript:(function(){navigator.clipboard.writeText(`<a target="_blank" rel="noreferrer" href="${location.href}">${document.title}</a>`).then(function(){alert('リンクを作成しました!')},function(){alert('エラー\n作成できませんでした。\nアドレスバーからフォーカスを外して、ページ表示部分をアクティブにして下さい。')})})();

Bloggerのコメントではtarget="_blank"属性は使えませんので、①の同一タブリンクを使用して下さい。

閲覧中のページの中身をチェック

自分のサイトはもちろんのこと、他所のサイトの構造とかも気になりますよね。カスタマイズの参考にもなりますし。

すべて新しいタブで開きます。

PageSpeed Insights

PSIで計測

javascript:void(window.open("https://pagespeed.web.dev/report?utm_source=psi&utm_medium=redirect&url="+encodeURIComponent(location.href)))

Lighthouse

すべてのカテゴリが有効になっています。

Lighthouseで計測(モバイル)

javascript:void(window.open("https://googlechrome.github.io/lighthouse/viewer/?psiurl="+encodeURIComponent(location.href)+"&strategy=mobile&category=performance&category=accessibility&category=best-practices&category=seo"))

Lighthouseで計測(デスクトップ)

javascript:void(window.open("https://googlechrome.github.io/lighthouse/viewer/?psiurl="+encodeURIComponent(location.href)+"&strategy=desktop&category=performance&category=accessibility&category=best-practices&category=seo"))

W3C

HTMLチェック

javascript:void(window.open("https://validator.w3.org/nu/?doc="+encodeURIComponent(location.href)))

CSSチェック

javascript:void(window.open("https://jigsaw.w3.org/css-validator/validator?uri="+encodeURIComponent(location.href)))

2022/03/31 追加: Schema.org

マークアップチェック

javascript:void(window.open("https://validator.schema.org/#url="+encodeURIComponent(location.href)))

2022/04/01 追加: Google Search Console

リッチリザルト テスト

javascript:void(window.open("https://search.google.com/test/rich-results?url="+encodeURIComponent(location.href)))

2022/05/02 追加: HTML 終了タグチェック

ファビコンWebテク倉庫
サムネイル
【 HTML終了タグチェッカー 】改訂版の再配布を致します | Webテク倉庫
弊ブログのこの記事 ↓ を発端にして、FC2ブログを「HTMLタグのみ」の改行設定で記事を書くブロガーさん達が増えつつあります。 最近の筆者の趣味は皆さんのブログ記事のHTMLソースを読むことです(笑)
https://oops0011.blog.fc2.com/blog-entry-214.html

JSファイルの中身をインライン化してあります。

HTML終了タグチェッカー

javascript:var w=window.open('','_blank','width=800,height=600,scrollbars=yes');var s=document.createElement('script');!function(e){function t(e){for(var t=0;t<o.length;t++){var n=o[t];if(n.head<=e&&e<n.tail)return!0;if(e<n.head)break}return!1}if(function(){var e=document.body.lastChild;"SCRIPT"==e.tagName&&"tagcheck-script"==e.id&&document.body.removeChild(e)}(),e){!function(){var t=e.document;t.open();var n=["<html>","<head>","<title>tagcheck result</title>",'<style type="text/css">',"* {font-size:10pt;margin:0;padding:0;font-family:sans-serif;word-break:break-all}","h1 {background:#339; padding:5px; color:white}","ol li{margin-left:30px;}","#summary {margin:10px;padding:1em; color:#660;font-weight:bold;}","#list {margin:10px;padding:1em; background:#eee;border:1px solid gray} ","#source{margin:10px;padding:3px;border:1px solid gray;background:#eee;}",".ln{background:white;min-width:30px;border-right:4px solid #9999cc;float:left;clear:both;padding-right:4px;text-align:right;margin-right:4px;}",".error{color:white;background:orange;font-weight:demi;}",".error a:link {text-decoration:none;}","a:focus {background:red;}",".success{border: 1px solid green;background:#ccffcc}",".fail{border:1px solid red;background:#ffcccc}",".show{display:block;}",".none{display:none;}",".o{background:#fbe7b6;}",".e{background:#ead6a5;}","</style>","</head>","<body>",'<div id="loading">now computing...',"</div>",'<div id="resultarea" class="none">',"<h1>チェック結果概要</h1>",'<div id="summary"></div>',"<h1>タグ対応エラー一覧</h1>",'<div id="list"></div>',"<h1>HTMLソース</h1>",'<div id="source"></div>','<div id="debug"></div>',"</div>","</body>","</html>"];t.write(n.join("\n")),t.close();var a=function(t){return e.document.getElementById(t)},r=function(e){var t=document.documentElement,n=e.getBoundingClientRect(),a=n.left-t.clientLeft,r=n.top-t.clientTop;return{left:a,top:r}};return e.showResult=function(e,t,n){var r=a("loading");r.parentNode.removeChild(r);var i=n.length;!function(){var e=a("summary"),t=0==i?"素晴らしい!とりあえずタグの対応だけは完璧です!":1==i?"惜しい!1個だけきちんと対応していないタグがあります。":"残念、"+i+"個のタグがきちんと対応していません。";e.innerHTML=t,e.className=i?"fail":"success"}(),function(){var t=1,r=function(e){return e.replace(/[<>&\r\n \t]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"\r":return"";case"\n":var n=t%2==0?"e":"o";return'</div>\n<div class="ln">'+ ++t+'</div><div class="'+n+'">&nbsp;';case"":return"&nbsp;&nbsp;&nbsp;&nbsp;";case" ":return"&nbsp;"}})},i=['<div class="ln">1</div><div class="e">&nbsp;'];n.sort(function(e,t){return e.head-t.head});for(var o=0,l=0,s=n.length;s>l;l++){var d=n[l];if(o<d.tail){var c=r(e.substring(o,d.head)),u=r(e.substring(d.head,d.tail));i.push(c,'<span class="error">','<a id = "a'+d.id+'"',' title="'+d.message+'"'," href=\"javascript:go('d"+d.id+"');\">",u,"</a></span>"),d.lineNumber=t,o=d.tail}}i.push(r(e.substring(o)),'<br clear="all">');var g=a("source");g.innerHTML=i.join("")}(),function(){for(var e=["<ol>"],t=0,r=n.length;r>t;t++){var i=n[t];e.push("<li>","("+i.lineNumber+"行目) ",'<a id="d'+i.id+'"'," href=\"javascript:go('a"+i.id+"');\">&lt;",i.tagName+i.attr,"&gt;</a> : ",i.message,"</li>")}e.push("</ol>"),a("list").innerHTML=e.join("")}(),a("resultarea").className="show"},e.go=function(t){var n=(e.scrollY||0,a(t));n.focus();var i=(e.scrollY||0,e.innerHeight),o=r(n).top,l=50;l>o?e.scrollBy(0,-i/2):o>i-l&&e.scrollBy(0,i/2)},e}();var n=function(){var e=function(){try{return window.XMLHttpRequest?new XMLHttpRequest:ActiveXObject?new ActiveXObject("Msxml2.XMLHTTP"):null}catch(e){return new ActiveXObject("Microsoft.XMLHTTP")}}();return e.open("GET",location.href,!1),e.send(""),e.responseText}(),a={},r={},i=[],o=[],l=["img","link","meta","br","hr","input","embed","area","base","basefont","bgsound","param","wbr","col","source","track","li"];l.indexOf=l.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]==e)return t;return-1},function(){for(var e=/(<script[^>]*>[\s\S]*?<\/script>)|(<\!--[\s\S]*?-->)/gim,t=null;t=e.exec(n);){var a=t.index,r=a+t[0].length;o.push({head:a,tail:r}),e.lastIndex=r}}(),function(){for(var e=function(e,t,n){var a=new RegExp("<(/)?"+n+"( [^>]*)?>","igm");a.lastIndex=t;for(var i=1,o=null;o=a.exec(e);)if("/"==o[1]){if(0==--i)return r[o.index]?!1:{head:o.index,tail:o.index+o[0].length}}else i++;return!1},o=/<([a-zA-Z1-9:]+)([^>]*)>/gm,s=null;s=o.exec(n);)if(!t(s.index)){var d=s.index,c=d+s[0].length,u=s[1].toLowerCase(),g=s[2];if(l.indexOf(u)>=0||g&&"/"==g.charAt(g.length-1))r[d]={open:d,openTail:c,close:d,closeTail:c,tagName:u,attr:g};else{var h=e(n,c,u);h?a[d]=r[h.head]={open:d,openTail:c,close:h.head,closeTail:h.tail,tagName:u,attr:g}:i.push({id:i.length,head:d,tail:c,tagName:u,attr:g,message:"タグが閉じていません"})}o.lastIndex=c}}(),function(){for(var e=/<\/([a-zA-Z1-9:]+)>/gm,a=null;a=e.exec(n);)if(!t(a.index)){var o=a.index,s=o+a[0].length,d=a[1].toLowerCase(),c="";l.indexOf(d)<0&&(r[a.index]||i.push({id:i.length,head:o,tail:s,tagName:"/"+d,attr:c,message:"開きタグがありません"})),e.lastIndex=s}}(),function(){var e=[];for(var t in a){for(var n=a[t],r=e.length-1;r>=0;r--){var o=e[r];o.open<n.open&&n.open<o.close&&o.close<n.close?(i.push({id:i.length,head:o.close,tail:o.closeTail,tagName:"/"+o.tagName,attr:"",message:"&lt;"+n.tagName+n.attr+"&gt;よりも先に閉じてしまっています"}),i.push({id:i.length,head:n.close,tail:n.closeTail,tagName:"/"+n.tagName,attr:"",message:"&lt;"+o.tagName+o.attr+"&gt;よりも後で閉じてしまっています"})):o.close<n.open&&e.splice(r,1)}e.push(n)}}(),e.showResult(n,r,i)}}(w);;document.body.appendChild(s);void(0);

その他

Internet Archive (Wayback Machine)

このページのアーカイブ

javascript:void(window.open("https://web.archive.org/web/*/"+location.href))

CSS を無効化

via: CSSを無効化するブックマークレット・改 - LogJET

CSS が効いてないすっぴんの状態で表示してくれます。クリックする毎に ON/OFF が出来ます。

CSS off/on

javascript:function tC(v,nf){if(document.getElementsByTagName('link')){links=document.getElementsByTagName('link');for(i=0;i<links.length;i++){link=links[i];if(link.href.indexOf('css')>=0|link.href.indexOf('CSS')>=0|link.type=='text/css'){link.disabled=v;}}}if(document.getElementsByTagName('style')){styles=document.getElementsByTagName('style');for(j=0;j<styles.length;j++){style=styles[j];style.disabled=v;}}document.getElementsByTagName('head')[0].id=nf;}if(document.getElementById('cssOFF')){tC(false,'cssON');}else{tC(true,'cssOFF');}

OFF にするだけならこんなシンプルなコードもあります。リロードすれば元に戻るので、こっちの方がオススメかも?

CSS off

javascript:void((function(){let i,x;for(i=0;x=document.styleSheets[i];++i)x.disabled=true;})())

画像だけ表示

via: 画像を一覧表示するブックマークレット(改良版) - 白牙隊A2屯所

探せば同様のものが色々見つかりますが、表示結果はこれが一番シンプルで好みでした。

作者さんは「document.write() をやめて全て createElement で作成…」と書いてますが、一箇所だけ document.write() 使われてますね。JS 詳しい方は自力で改善してくださいw

ページ内の <img> タグで表示されている画像と画像 URL を一覧表示します。

当ブログのトップページや関連記事のサムネ等、右クリックメニューやドラッグ&ドロップで別タブ表示や保存が出来ないとか、画像URLが確認できない時などに重宝します。ソースコードやデベロッパーツールで確認するのは面倒なのでw

背景画像(background-image)は表示できません。
Lazyload で読み込まれていない画像は表示されません。URL はページの URL になります。

画像だけ表示

javascript:b=document.images;a=new Array();for(i=0;i<b.length;i++){a[i]=b[i].src;};base=document.createElement("div");document.body.appendChild(base);document.write("<div id='imageslist' style='word-break:break-all'></div>");const list=document.getElementById('imageslist');for(j=0;j<a.length;j++){div=document.createElement("div");div.id='img-Id-'+a[j];c=document.createElement("img");c.src=a[j];list.appendChild(div);tgt=document.getElementById(div.id);const link=document.createElement("a");link.setAttribute("href", c.src);link.innerHTML=c.src+'<br>';tgt.appendChild(link);tgt.appendChild(c);const hr=document.createElement("hr");tgt.appendChild(hr);};

2022/04/09 追加: meta 情報と画像情報を表示

ファビコンcly7796.net
サムネイル
マークアップ後の画像やmetaをチェックするブックマークレットを作ってみた
https://cly7796.net/blog/other/markup-check-tool/

配色のみ自分好みに変更しました。

meta & 画像情報

javascript:(function(){null!=document.getElementById("markupCheck")&&document.body.removeChild(document.getElementById("markupCheck"));var bg=document.createElement("div"),bar=document.createElement("div"),wht=document.createElement("span"),blk=document.createElement("span"),cls=document.createElement("span"),bgStyle="position:absolute;top:0;left:0;z-index:9999;width:100%;line-height:1.2;padding-top:50px;padding-left:5px;color:#000000;font-size:14px;font-family:verdana;text-align:left;background:#fbfbff;";barStyle="position:fixed;top:0;left:0;width:100%;height:50px;background:#242f45;",whtStyle="position:absolute;bottom:5px;left:10px;width:20px;height:20px;background:#fff;cursor:pointer;",blkStyle="position:absolute;bottom:5px;left:40px;width:20px;height:20px;border:1px solid #fff;background:#000;cursor:pointer;",clsStyle="position:absolute;top:15px;right:10px;width:20px;height:20px;color:#000000;font-size:18px;text-align:center;background:#999999;cursor:pointer;",bg.id="markupCheck",bg.style.cssText=bgStyle,bar.style.cssText=barStyle,blk.style.cssText=blkStyle,wht.style.cssText=whtStyle,cls.style.cssText=clsStyle,cls.innerHTML="×",bar.innerHTML='<span style="position:absolute;top:5px;left:10px;color:#ffffff;font-size:12px;">背景色変更</span>',document.body.appendChild(bg).appendChild(bar).appendChild(cls),bar.appendChild(blk),bar.appendChild(wht),window.scrollTo(0,0),cls.onclick=function(){document.body.removeChild(bg)},blk.onclick=function(){bg.style.backgroundColor="#171d2b",bg.style.color="#eee"},wht.onclick=function(){bg.style.backgroundColor="#fbfbff",bg.style.color="#333"};for(var imgAlt=new Array,imgSrc=new Array,imgAW=new Array,imgNW=new Array,imgAH=new Array,imgNH=new Array,images=document.getElementsByTagName("img"),i=0;i<images.length;i++)imgAlt[i]=images[i].getAttribute("alt"),imgSrc[i]=images[i].src,imgAW[i]=images[i].getAttribute("width"),imgNW[i]=images[i].naturalWidth,imgAH[i]=images[i].getAttribute("height"),imgNH[i]=images[i].naturalHeight;var imageIns="",ttlStyle="margin:0 0 10px;font-size:28px;font-weight:bold;",imgBoxStyle="overflow:hidden;margin-bottom:15px;border-bottom:#999999 1px dotted;padding-bottom:15px;",srcStyle="margin-bottom:5px;padding-right:40%;",imgWrStyle="margin-bottom:10px;",imgStyle="max-width:60%;max-height:250px;",altStyle="max-width:60%;margin-bottom:10px;",dataStyle="float:right;width:40%;",typStyle="font-weight:bold;",itemStyle="display:inline-block;width:4em;margin-right:5px;padding:2px 0;font-size:16px;font-weight:bold;text-align:center;background:pink;color:#333",sizeStyle="display:inline-block;padding:3px 2px;",dataSpcStyle="display:inline-block;margin-right:10px;margin-bottom:10px;",errStyle="color:#ffffff;background:tomato;",attStyle="color:#000000;background:gold;";imageIns+='<p style="'+ttlStyle+'">■画像リスト</p>';for(i=0;i<images.length;i++)imageIns+='<div style="'+imgBoxStyle+'">',imageIns+='<div style="'+srcStyle+'">',imageIns+=imgSrc[i],imageIns+="</div>",imageIns+='<div style="'+imgWrStyle+'">',imageIns+='<img src="'+imgSrc[i]+'" style="'+imgStyle+'" />',imageIns+="</div>",imageIns+='<div class="alt" style="'+altStyle+'">',null==imgAlt[i]?imageIns+='<span style="'+errStyle+'">alt がありません。</span>':""==imgAlt[i]?imageIns+='<span style="'+attStyle+'">alt が空です。</span>':imageIns+="<span>"+imgAlt[i]+"</span>",imageIns+="</div>",imageIns+='<div class="sizew" style="'+dataSpcStyle+'">',imageIns+='<div style="'+itemStyle+'">width</div>',null==imgAW[i]?imageIns+='<span style="'+sizeStyle+attStyle+'">width がありません。</span>':""==imgAW[i]?imageIns+='<span style="'+sizeStyle+attStyle+'">width が空です。</span>':-1!=imgAW[i].indexOf("%")?imageIns+='<span style="'+sizeStyle+'">'+imgAW[i]+"</span>":imgAW[i]!=imgNW[i]?Math.abs(imgAW[i]-imgNW[i]/2)<=.5?(imageIns+='<span style="'+sizeStyle+'">Retina対応っぽいです。</span>',imageIns+='<span style="'+sizeStyle+typStyle+'">実際:</span><span>'+imgNW[i]+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">半分:</span><span>'+imgNW[i]/2+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">指定:</span><span>'+imgAW[i]+"px</span>"):(imageIns+='<span style="'+sizeStyle+attStyle+'">実サイズと一致していません。</span>',imageIns+='<span style="'+sizeStyle+typStyle+'">実際:</span><span>'+imgNW[i]+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">指定:</span><span>'+imgAW[i]+"px</span>"):imageIns+='<span style="'+sizeStyle+'">'+imgAW[i]+"px</span>",imageIns+="</div>",imageIns+='<div class="sizeh" style="'+dataSpcStyle+'">',imageIns+='<div style="'+itemStyle+'">height</div>',null==imgAH[i]?imageIns+='<span style="'+sizeStyle+attStyle+'">height がありません。</span>':""==imgAH[i]?imageIns+='<span style="'+sizeStyle+attStyle+'">height が空です。</span>':-1!=imgAH[i].indexOf("%")?imageIns+='<span style="'+sizeStyle+'">'+imgAH[i]+"</span>":imgAH[i]!=imgNH[i]?Math.abs(imgAH[i]-imgNH[i]/2)<=.5?(imageIns+='<span style="'+sizeStyle+'">Retina対応っぽいです。</span>',imageIns+='<span style="'+sizeStyle+typStyle+'">実際:</span><span>'+imgNH[i]+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">半分:</span><span>'+imgNH[i]/2+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">指定:</span><span>'+imgAH[i]+"px</span>"):(imageIns+='<span style="'+sizeStyle+attStyle+'">実サイズと一致していません。</span>',imageIns+='<span style="'+sizeStyle+typStyle+'">実際:</span><span>'+imgNH[i]+"px</span> ",imageIns+='<span style="'+sizeStyle+typStyle+'">指定:</span><span>'+imgAH[i]+"px</span>"):imageIns+='<span style="'+sizeStyle+'">'+imgAH[i]+"px</span>",imageIns+="</div>",imageIns+="</div>";var keywords,description,canonical,alternate,metaData=document.getElementsByTagName("meta"),metaTitle=document.getElementsByTagName("title"),linkData=document.getElementsByTagName("link"),ogArray=[],twArray=[],ogFlag=!1,twFlag=!1;for(i=0;i<metaData.length;i++){switch(metaData[i].getAttribute("name")){case"keywords":keywords=metaData[i].getAttribute("content");break;case"description":description=metaData[i].getAttribute("content")}if(null!=metaData[i].getAttribute("property")&&metaData[i].getAttribute("property").match(/og:/)){ogFlag=!0;ogArray.push([metaData[i].getAttribute("property"),metaData[i].getAttribute("content")])}if(null!=metaData[i].getAttribute("name")&&metaData[i].getAttribute("name").match(/twitter:/)){twFlag=!0;twArray.push([metaData[i].getAttribute("name"),metaData[i].getAttribute("content")])}}for(i=0;i<linkData.length;i++)switch(linkData[i].getAttribute("rel")){case"canonical":canonical=linkData[i].getAttribute("href");break;case"alternate":alternate=linkData[i].getAttribute("href")}var metaIns="",dlStyle="margin-bottom:10px;",dtStyle="display:inline-block;width:10em;margin-right:10px;padding:2px 6px;font-size:16px;font-weight:bold;background:#666;border-radius:3px;color:#fff",ddStyle="padding:2px;",linkStyle="color:deepskyblue;";if(metaIns+='<p style="'+ttlStyle+'">■meta情報</p>',metaIns+='<div style="margin-bottom:30px;">',metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">title</span>',metaTitle.length?metaTitle[0].childNodes.length?metaIns+='<span style="'+ddStyle+'">'+metaTitle[0].childNodes[0].nodeValue+"</span>":metaIns+='<span style="'+errStyle+'">titleタグが空です。</span>':metaIns+='<span style="'+errStyle+'">titleタグがありません。</span>',metaIns+="</div>",metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">keywords</span>',metaIns+=null==keywords?'<span style="'+attStyle+'">keywordsタグがありません。</span>':""==keywords?'<span style="'+attStyle+'">keywordsタグが空です。</span>':'<span style="'+ddStyle+'">'+keywords+"</span>",metaIns+="</div>",metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">description</span>',metaIns+=null==description?'<span style="'+attStyle+'">descriptionタグがありません。</span>':""==description?'<span style="'+attStyle+'">descriptionタグが空です。</span>':'<span style="'+ddStyle+'">'+description+"</span>",metaIns+="</div>",ogFlag)for(i=0;i<ogArray.length;i++)metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">'+ogArray[i][0]+"</span>",""==ogArray[i][1]?metaIns+='<span style="'+attStyle+'">'+ogArray[i][0]+"が空です。</span>":"og:url"==ogArray[i][0]?metaIns+='<span style="'+ddStyle+'"><a href="'+ogArray[i][1]+'" target="_blank" style="'+linkStyle+'">'+ogArray[i][1]+"</a></span>":"og:image"==ogArray[i][0]?(metaIns+='<span style="'+ddStyle+'">',metaIns+='<a href="'+ogArray[i][1]+'" target="_blank" style="'+linkStyle+'">'+ogArray[i][1]+"</a><br />",metaIns+='<img src="'+ogArray[i][1]+'" style="max-width:100%;max-height:250px" />',metaIns+="</span>"):metaIns+='<span style="'+ddStyle+'">'+ogArray[i][1]+"</span>",metaIns+="</div>";if(twFlag)for(i=0;i<twArray.length;i++)metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">'+twArray[i][0]+"</span>",""==twArray[i][1]?metaIns+='<span style="'+attStyle+'">'+twArray[i][0]+"が空です。</span>":"twitter:site"==twArray[i][0]?(metaIns+='<span style="'+ddStyle+'">',metaIns+='<a href="https://twitter.com/'+twArray[i][1].replace("@","")+'" target="_blank" style="'+linkStyle+'">',metaIns+=twArray[i][1],metaIns+="</a>",metaIns+="</span>"):"twitter:image"==twArray[i][0]?(metaIns+='<span style="'+ddStyle+'">',metaIns+='<a href="'+twArray[i][1]+'" target="_blank" style="'+linkStyle+'">',metaIns+=twArray[i][1],metaIns+="</a><br />",metaIns+='<img src="'+twArray[i][1]+'" style="max-width:100%;max-height:250px" />',metaIns+="</span>"):metaIns+='<span style="'+ddStyle+'">'+twArray[i][1]+"</span>",metaIns+="</div>";null!=canonical&&(metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">canonical</span>',metaIns+=""==canonical?'<span style="'+attStyle+'">canonicalが空です。</span>':'<span style="'+ddStyle+'"><a href="'+canonical+'" target="_blank" style="'+linkStyle+'">'+canonical+"</a></span>",metaIns+="</div>"),null!=alternate&&(metaIns+='<div style="'+dlStyle+'"><span style="'+dtStyle+'">alternate</span>',metaIns+=""==alternate?'<span style="'+attStyle+'">alternateが空です。</span>':'<span style="'+ddStyle+'"><a href="'+alternate+'" target="_blank" style="'+linkStyle+'">'+alternate+"</a></span>",metaIns+="</div>"),metaIns+="</div>";var metaList=document.createElement("div");metaList.id="metaList",metaList.innerHTML=metaIns,bg.appendChild(metaList);var imgList=document.createElement("div");imgList.id="imglist",imgList.innerHTML=imageIns,bg.appendChild(imgList)})()

最後に

他にもオススメの(特にブログ運営に役立ちそうな)ブックマークレットがあるよって方がいたら、教えて下さい(´▽`)

いいのがあれば随時追加・入替えするかもしれません。