常設「styleタグ」の有無をチェック
「Every Page」が書込んだ常設「styleタグ」が、記事中に有るか無いかを自動でチェックするツールです。
このツールは、特定の「記事の編集・削除」のページをチェックするための簡易ツールです。 ブログの広範囲の記事の調査には「Every Page Worker 💢💢 Search」を使う事をお勧めします。「Search」はページ進行も自動で行い、処理速度も優れています。 ただし「Search」は適切な検索文字列の設定が必要です。
「Every Page Checker」ver.1.1 の操作について
「Every Page Checker」をONにする前に
● ブラウザのポップアップブロック設定が有効になっていると正常な動作を妨げられます。 以下のページ末尾のブロック解除の設定方法に従い「https://blog.ameba.jp」を解除URLに追加してください。
▪ Firefoxで使用する際は、ブラウザの「オプション」→「タブグループ」の設定で、「新しいウィンドウではなく新しいタブに開く」を指定してください。
●「Every Page Checker」をONにする際は、他のブログ編集画面、ブラウザの他画面などを閉じておきます。
● 同類ツールの「Every Page」「Every Page Plain」「Auto Style Attach」はOFFにしておく事が必須です。 ブログ編集画面で動作する JavaScriptツールも OFFにしておくのがベストです。
● 一括処理は「記事の編集・削除」のページ単位で処理をします。 記事の少ないページでテストをして処理を確認してから、ブログ全体の処理をする事をお勧めします。
● このツールは、「styleタグ」の一括削除を行う場合にのみ ONとし、常駐させて使用するスクリプトではありません。
▪「Every Page Checker」を ONにすると、幾つかの画面が通常と異なる挙動をする場合があります。 作業が終了したら、安全のために必ず OFFにしてください。
処理のスタート
●「Tampermonkey」のダッシュボードで「Every Page Checker」を「ON」にします。
●「記事の編集・削除」の画面をリロードするとツールがスタンバイして、下の様な「スタートスイッチ」(赤枠)が表示されます。 また、リスト画面全体が少しコンパクトになります。
● リストのウインドウを、デスクトップの右側寄りに配置します。
● ボタンを押すと確認のダイアログが出て、「OK」を押すと処理が開始されます。 処理は1分半程度で終了します。(ブラウザのリロードで処理を中止できます)
下は、処理が開始された状態で、左側に小型化した編集ウインドウが記事ごとに開き、各記事の処理が終わると自動的に閉じます。 右の元画面は、処理の進行に従って、記事の単位で背景色が変化します。
● 以下は処理経過のサンプルです。
常設「styleタグ」が無い場合は「淡いグレー」になります。
▪もし常設「styleタグ」が有った場合は、処理中の「青枠」で背景が「白」の表示が残ったままになります。 また左側の小型の編集ウインドウは消えずに残ります。
●「処理中」や「未処理」を残してスクリプトが停止する場合は、通信環境が良くない可能性があります。
● ページを移動すると、上図の結果表示の配色はリセットされます。
「Every Page Plane」を利用するには
このツールは Chrome / Edge / Firefox版の拡張機能「Tampermonkey」上で動作します。 以下に、このツールの導入手順を簡単に説明します。
❶「Tampermonkey」を導入します
◎ 使用しているブラウザに拡張機能「Tampermonkey」を導入する事が必要です。
既に「Tampermonkey」を導入している場合は、この手順 ❶ は不要です。
拡張機能の導入については、以下のページに簡単な説明があるので参照ください。
❷「Tampermonkey」にスクリプトを登録します
◎「Tampermonkey」の「+」マークの「新規スクリプト」タブを開きます。
◎「新規スクリプト」には、最初からテンプレートが記入されています。 これは全て削除して、完全に空白の編集枠に 下のコードをコピー&ペーストします。
〔コピー方法〕 軽量シンプルなツール「PreBox Button 」を使うと
コード枠内を「Ctrl+左Click」➔「Copy code 」を「左Click」
の操作で、掲載コードのコピーが可能になります。
◎ 最後に「ファイル」メニューの「保存」を押すと、ツールが使用可能になります。
〔 Every Page Checker 〕 ver. 1.1
// ==UserScript== // @name Every Page Checker // @namespace http://tampermonkey.net/ // @version 1.1 // @description 「記事の編集・削除」ページで「常設 styleタグ」をチェックする // @author Ameba Blog User // @match https://blog.ameba.jp/ucs/entry/srventrylist* // @match https://blog.ameba.jp/ucs/entry/srventryupdate* // @run-at document-start // @grant none // ==/UserScript== window.addEventListener('DOMContentLoaded', function(){ // CSSデザインを適用するためのスクリプト let style= '<style>'+ '.include-ex-linkBtn, .save-browserPush, .save-hashtag-module, .adcrossBanner { '+ 'display: none !important; } '+ '#globalHeader, #ucsHeader, #ucsMainLeft h1, .l-ucs-sidemenu-area, #ucsMainRight, '+ '.actionControl, .list_icon, #footerAd, #globalFooter, .checkboxAllControl, '+ '.selection-bar { display: none !important; } '+ '#ucsContent { width: 840px !important; background: #fff; '+ 'box-shadow: 0 0 0 100vh #c5d8e1; border-radius: 0; } '+ '#ucsContent::before { content: unset; } '+ '#ucsMain { margin-top: 15px; padding: 0 !important; background: #fff; '+ 'border-radius: 0; } '+ '#ucsMainLeft { width: 838px !important; padding: 0 15px; float: none; } '+ '#entryList li { padding: 4px 5px 0 !important; height: 32px; } '+ '#entryList li:hover { background-color: #e2eef0; } '+ '#entryList li .entry-column { padding-left: 16px !important; } '+ '#entryList .leftCol { justify-content: center; } '+ '#entryList .leftCol h2 a { text-decoration: none !important; } '+ '#entryList .leftCol dl { display: none !important; } '+ '#entryList .leftCol, #entryList .titleCol h2 { width: 353px !important; } '+ '#entryList .leftCol a:hover { text-decoration: none; } '+ '#entryList .leftCol a:visited { color: #3970b5; } '+ '#entryList .txtCol { white-space: nowrap; font-size: 13px; margin-bottom: 2px; '+ 'line-height: 16px; } '+ '#entryList .rightCol { display: flex; width: 410px !important; padding: 8px 0; '+ 'flex-direction: row; margin-top: -2px; margin-left: 0; } '+ '#entryList .status-text { width: 64px; margin-bottom: -4px; padding: 2px 4px 0; '+ 'font-weight: normal; color: #000; } '+ '#entryList ul input[value="1"] + input + li .txtCol span:first-child { '+ 'display: inline-block; text-indent: 12px; color: #fff; background: #2196f3 !important; } '+ '#entryList ul input[value="2"] + input + li .txtCol span:first-child { display: inline-block; '+ 'text-indent: 2px; overflow: hidden; color: #fff; background: #009688 !important; } '+ '#entryList .txtCol .date { display: inline-block; padding: 2px 4px 0; font-size: 13px; '+ 'color: #000; } '+ '#entryList .deleteCol { margin: 0 !important; } '+ '#entryList .deleteCol .process+.process, #entryList dd+dd { margin-left: 10px; } '+ '#entryList .deleteCol a { padding: 2px 5px 0; font-size: 14px; '+ 'text-decoration: none !important; border: 1px solid #aaa; border-radius: 4px; '+ 'background: linear-gradient(0deg, #eee, #fff); overflow: hidden; } '+ '#entryList .deleteCol a:hover { outline: auto #1976d2; } '+ '#entryList .deleteCol .process svg { width: 16px; height: 16px; } '+ '#sorting{ margin: 0 0 4px; padding: 4px 10px; height: 24px; } '+ '#sorting ul { padding-top: 3px; } '+ '#sorting >span { font-size: 15px; line-height: 15px; font-weight: bold; '+ 'display: inline-block; margin-left: 50px; padding: 3px 6px 0; '+ 'border: 1px solid #aaa; border-radius: 4px; background: #fff; cursor: pointer; } '+ '.pagingArea .active { border: 2px solid #0066cc; }'+ '</style>'; document.head.insertAdjacentHTML('beforeend', style); }) window.addEventListener('load', function(){ // このスクリプトは孫ウインドウだけで働く let body_id=document.body.getAttribute('id'); if(body_id=="entryCreate"){ // この項だけ孫ウインドウで働く select_e(close_w); function select_e(close_w){ let error_report=document.querySelector('h1.p-error__head'); if(error_report==null){ if(window.opener){ report('gray'); window.opener.close(); }} // エラー無い場合 grayを送信 親ウインドウを閉じる else{ if(window.opener){ report('red'); window.opener.location.reload(); }} // エラー報告のある場合は redを送信 親ウインドウを残す close_w(); } function close_w(){ let close_button=document.querySelector('.entryComplete__close'); close_button.click(); } // 子ウインドウは常に閉じる function report(color){ window.opener.document.querySelector('html').style.color=color; }}}) window.addEventListener('load', function(){ // このスクリプトは親ウインドウで働くメインスクリプト var entry_target; var publish_f; var list_bar; var new_win; var link_target; var result_f; entry_target=document.querySelectorAll('.deleteCol'); publish_f=document.querySelectorAll('input[name="publish_flg"]'); list_bar=document.querySelectorAll('#entryList li'); let body_id=document.body.getAttribute('id'); if(body_id=='entryListEdit'){ let start_button= '<p id="start_ep">Start Processing'+ '<style>'+ '#sorting { position: relative; } '+ '#start_ep { position: absolute; top: 4px; right: 15px; font: bold 14px Meiryo; '+ 'width: auto; padding: 1px 15px 0; border: 1px solid #aaa; border-radius: 4px; '+ 'background: #fff; cursor: pointer; }'+ '</style></p>'; let sorting=document.querySelector('#sorting'); if(sorting){ sorting.insertAdjacentHTML('beforeend', start_button); } let start_ep=document.querySelector('#start_ep'); if(start_ep){ start_ep.onclick=function(){ start_select(); }; function start_select(){ sorting.removeChild(start_ep); if(entry_target.length==0 || entry_target==null){ // 編集対象がリストに無い場合 alert('編集対象の記事がありません'); } if(entry_target.length >0){ // 編集対象がリストに有る場合 let ok=confirm('このページの検査対象記事:' + entry_target.length + '\n ⛔タグチェックを実行しますか?'); if(ok){ open_all(); }}} }} function open_all(){ entry_target=document.querySelectorAll('.deleteCol'); publish_f=document.querySelectorAll('input[name="publish_flg"]'); new_win=Array(entry_target.length); link_target=Array(entry_target.length); result_f=Array(entry_target.length); open_win(0); if(entry_target.length>1){ let k=1; let slow_open=setInterval( function(){ open_win(k); k +=1; if(k>=entry_target.length){ clearInterval(slow_open); }}, 2400); }} // 2.4secの間隔で自動実行 ⭕ function open_win(k){ result_f[k]=0; entry_target=document.querySelectorAll('.deleteCol'); publish_f=document.querySelectorAll('input[name="publish_flg"]'); link_target[k]=entry_target[k].getElementsByTagName('a')[0].getAttribute('href'); let top_p=100 + 30*k; new_win[k]=window.open(link_target[k], k, 'top=' + top_p + ', left=100, width=600, height=180'); result_f[k]=1; // 読込み開始 list_bar[k].style.boxShadow='inset 0 0 0 2px #03a9f4'; // リスト欄に青枠表示 new_win[k].addEventListener('load', function(){ setTimeout( function(){ edit_target(publish_f[k].value, k); }, 500); });} // 子ウインドウで書込み開始 function edit_target(val,k){ let editor_flg=new_win[k].document.querySelector('input[name="editor_flg"]'); if(editor_flg.value=='5'){ // 最新版エディタの文書の場合 let editor_iframe=new_win[k].document.querySelector('.cke_wysiwyg_frame'); let iframe_doc=editor_iframe.contentWindow.document; if(iframe_doc){ let iframe_body=iframe_doc.querySelector('body.cke_editable'); let style_tag=iframe_doc.querySelector('style.asa'); if(style_tag){ ; } // 送信せずウインドウを残す else{ new_win[k].close(); result_f[k]=2; // 無処理 list_bar[k].style.boxShadow='none'; list_bar[k].style.backgroundColor='#eceff1'; }}} // 検査OKなら子ウインドウを閉じ 背景 淡グレー if(editor_flg.value=='1'){ // タグ編集エディタの文書の場合 let preview=new_win[k].document.getElementById('js-light-preview'); let tageditor_text=new_win[k].document.getElementById('entryTextArea'); let style_tag=preview.querySelector('style.asa'); if(style_tag){ ; } // 送信せずウインドウを残す else{ result_f[k]=2; // 無処理 list_bar[k].style.boxShadow='none'; list_bar[k].style.backgroundColor='#eceff1'; new_win[k].close(); }} // 検査OKなら子ウインドウを閉じ 背景 淡グレー function twice(end_do,k){ setTimeout( function(){ publish_do(val,k); }, 500); end_do(k); } function end_do(k){ // 送信操作の進行中 result_f[k]=3; // 送信処理 new_win[k].addEventListener('beforeunload', flag_line , false); } function flag_line(){ let send_color=new_win[k].document.querySelector('html').style.color; if(send_color=='gray'){ // 正常終了の報告 result_f[k]=4; // 正常終了の報告 list_bar[k].style.boxShadow='none'; list_bar[k].style.backgroundColor='#a4d5fd'; } // 孫ウインドウが編集ウインドウが閉じたら 背景 淡ブルー if(send_color=='red'){ result_f[k]=5; // エラー終了の報告 list_bar[k].style.boxShadow='inset 0 0 0 2px red'; list_bar[k].style.backgroundColor='#fff'; }} // 孫ウインドウのエラー報告の場合は閉じず 背景 白 赤枠 function publish_do(val,k){ let publish_b0=new_win[k].document.querySelector('button.js-submitButton[publishflg="0"]'); let publish_b1=new_win[k].document.querySelector('button.js-submitButton[publishflg="1"]'); if(val==0){ publish_b0.click(); } if(val==1){ publish_b1.click(); } if(val==2){ publish_b0.click(); }}} })
「Every Page Checker」最新版について
旧いバージョンの JavaScriptツールは、アメーバのページ構成の変更で動作しない場合があり、導入する場合は最新バージョンをお勧めします。
●「Every Page Checker」の最新バージョンへのリンクは、以下のページのリンクリストから探せます。