「Aid AmbH」は、「HOME」を起点とした各情報へのアクセス環境を向上させるツールです。 主に2つの機能を持ちますが、以下に操作を纏めました。
「ホームへ」のリンクボタンの機能拡張
「Aid AmbH」は全てのブログ・アメンバー記事の「アメブロヘッダー」で機能します。 訪れた記事のアメブロヘッダーに「ホーム」「ピグ」「アメブロ」のカラーアイコンを表示して、「Aid AmbH」が機能している事を示します。
● アメブロヘッダーの「ホーム」ボタンの動作が以下の仕様になります。
▪「HOME」から開いたタブの場合は、「Click」で現在のタブを閉じる
▪「HOME」から開いた確認ができない場合は、「HOME」画面に遷移する
▪ ボタンを「Shift+Click」した場合は、常に「HOME」画面に遷移する
「ピグ」「アメブロ」のボタンは、デザイン変更のみで動作は元と同じです。
〔機能の制限〕
「HOME」から開いたブログページから更に別ページを開いた場合は、そのタブが閉じる場合と、閉じずに「HOME」画面に遷移する場合があります。
コメント参照機能
「HOME」画面の以下の場所のリンクで、「コメント参照機能」が機能します。
❶ ❷ の場所にある「コメントしたページへのリンク」の動作が変わります。
●「左Click」で、常に「コメント欄」を表示します。
これらは「コメント欄」を見る時に押すものと考えた変更です。 もし「コメント欄」以外の参照が目的なら、開いたモーダルウインドウを「×」を押して閉じます。
❸ はフォローフィードは「コメント欄」表示機能が追加されます。
● フォローフィードの「左Click」は、本来の記事へのリンクとして機能します。
● フォローフィードの「Shift+左Click」で、記事の「コメント欄」表示します。
▪「スタッフブログ」のリンクも同様に扱えます。
その他
❶ から開くの「お知らせ」画面の「~コメントが承認されました」の行は、その「コメント欄」を表示するリンクになり、行の左端にバーを表示します。(下図の矢印)
▪ 承認後に一定日数が過ぎると、「~コメントが承認されました」の行は「管理トップ」へのリンクに変わり、この場合は処理をしないのでバー表示をしません。
▪ JavaScript ツール「Let's Iine」と「Aid AmbH」と同時に使用すると、「Aid AmbH」の「コメント欄」表示が正常に機能しません。「Let's Iine」はOFFにしてください。
コードを更新しました
ver. 0.7 では、「フォローフィード」のリストを「もっと見る」のボタンで追加すると、2回目以降のリストには「コメント欄」表示機能が追加されませんでした。
また、「Follow Feed Checker」も「HOME」の機能拡張ツールですが、このツールの「フォローフィード」の自動更新で、「コメント欄」表示機能が無効になる事が判りました。
これらは、いずれも「Aid AmbH」が「フォローフィード」のリストの更新に対応していない事が原因で、今回の ver. 0.8 は、この問題を改善しました。
「Aid AmbH」を利用するには
❶ 拡張機能「Tampermonkey」の導入
「Tampermonkey」の導入手順は、以下のページを参照ください。
「Tampermonkey」は、使用しているブラウザに適した版を導入する必要があります。 既にこの拡張機能を導入している場合は、❶の手順は不要です。
❷「Aid AmbH」のインストール
●「Tampermonkey」の「+」マークの「新規スクリプト」タブを開きます。
●「新規スクリプト」には、最初からテンプレートが記入されています。 これは全て削除して、完全に空白の編集枠に 下のコードをコピー&ペーストします。
〔コピー方法〕 軽量シンプルなツール「PreBox Button 」を使うと
コード枠内を「Ctrl+左Click」➔「Copy code 」を「左Click」
の操作で、掲載コードのコピーが可能になります。
● 最後に「ファイル」メニューの「保存」を押すと、ツールが使用可能になります。
〔 Aid AmbH 〕ver. 0.8
// ==UserScript== // @name Aid AmbH // @namespace http://tampermonkey.net/ // @version 0.8 // @description 「HOME」「ブログ」のリンク動作を改善 // @author Ameba blog User // @match https://ameblo.jp/* // @match https://secret.ameba.jp/* // @match https://www.ameba.jp/home // @match https://www.ameba.jp/notifications // @noframes // @grant none // ==/UserScript== if(location.hostname!='www.ameba.jp'){ // 通常のブログページ等 let once=0; // 処理の複数回動作を抑止 let target0=document.querySelector('head'); let monitor0=new MutationObserver(main); monitor0.observe(target0, { childList: true }); main(); function main(){ let amember= document.querySelector('[data-uranus-component="amemberLabel"]'); let toHome; if(!amember){ toHome=document.querySelector('._2sLQpDcQ:nth-child(2)'); } else if(amember){ toHome=document.querySelector('.-ameblo-cmnhf-mypage a'); } let css; if(!amember){ let amb_header=document.querySelector('#ambHeader'); let icon=document.querySelectorAll('._2sLQpDcQ svg'); if(icon.length=='3'){ let svg0= '<svg width="24" height="24" viewBox="0 0 64 64">'+ '<g transform="translate(0,64) scale(0.1,-0.1)">'+ '<path d="M212 558 c-7 -7 -12 -35 -12 -64 0 -28 -7 -68 -15 -87 -8 '+ '-20 -15 -66 -15 -104 0 -61 -3 -69 -27 -89 -32 -25 -27 -60 8 -49 14 '+ '5 25 2 30 -6 8 -11 12 -10 24 5 15 20 15 20 15 -1 0 -11 -9 -28 -20 -38 '+ '-31 -28 -8 -47 54 -43 44 3 51 6 54 25 4 30 20 30 24 1 3 -20 10 -23 54 '+ '-26 62 -4 85 15 54 43 -11 10 -20 27 -20 38 0 21 0 21 15 1 12 -15 16 '+ '-16 24 -5 5 8 16 11 30 6 35 -11 40 24 8 49 -25 20 -27 28 -27 91 -1 39 '+ '-7 88 -15 110 -8 22 -15 61 -15 86 0 30 -6 51 -15 59 -13 11 -21 8 -48 '+ '-18 -42 -41 -75 -41 -112 -2 -32 34 -36 35 -53 18z m38 -148 c0 -5 -4 '+ '-10 -10 -10 -5 0 -10 5 -10 10 0 6 5 10 10 10 6 0 10 -4 10 -10z m150 '+ '0 c0 -5 -4 -10 -10 -10 -5 0 -10 5 -10 10 0 6 5 10 10 10 6 0 10 -4 10 '+ '-10z m-103 -28 c-19 -20 -7 -42 23 -42 30 0 42 22 23 42 -16 18 -16 18 '+ '3 12 26 -9 64 -45 64 -60 0 -6 -7 -18 -16 -25 -14 -11 -21 -11 -45 3 -27 '+ '16 -31 16 -58 0 -24 -14 -31 -14 -45 -3 -9 7 -16 19 -16 25 0 20 48 59 '+ '79 65 2 1 -3 -7 -12 -17z m61 -128 c33 -23 27 -73 -10 -94 -25 -13 -31 '+ '-13 -55 0 -38 21 -44 71 -11 94 12 9 29 16 38 16 9 0 26 -7 38 -16z"/>'+ '</g></svg>'; let svg1= '<svg width="24" height="24" viewBox="0 0 64 64">'+ '<g transform="translate(0,64) scale(0.1,-0.1)">'+ '<path d="M255 506 c-74 -33 -95 -88 -95 -256 0 -117 2 -132 20 -150 '+ '24 -24 48 -25 78 -4 17 12 22 25 22 59 l0 44 35 -6 c105 -17 213 93 '+ '191 194 -23 105 -148 164 -251 119z m119 -112 c20 -20 20 -43 0 -72 '+ '-18 -26 -50 -28 -76 -5 -36 33 -13 93 37 93 13 0 31 -7 39 -16z"/>'+ '</g></svg>'; let svg2= '<svg width="24" height="24" viewBox="0 0 64 64">'+ '<g transform="translate(0,64) scale(0.1,-0.1)">'+ '<path d="M267 519 c-48 -28 -61 -116 -23 -154 87 -87 217 6 161 115 '+ '-8 16 -24 34 -34 40 -25 13 -81 12 -104 -1z"/>'+ '<path d="M255 291 c-51 -23 -101 -79 -116 -132 -20 -64 -7 -69 181 -69 '+ '188 0 201 5 181 69 -15 53 -65 109 -116 132 -50 23 -80 23 -130 0z"/>'+ '</g></svg>'; set_svg(0, svg0); set_svg(1, svg1); set_svg(2, svg2); function set_svg(n, path){ let svg_d=document.createElement('div'); svg_d.id='svg_d'+n; svg_d.innerHTML=path; if(!amb_header.querySelector('#svg_d'+n)){ icon[n].parentNode.replaceChild(svg_d, icon[n]); }}} css= '._2sLQpDcQ svg { '+ 'border: 1px solid #aaa; border-radius: 4px; transition: .2s;'+ 'padding: 0 2px; margin: 0 4px 0 15px; vertical-align: -9px; } '+ '#svg_d0 svg { fill: #009688; } '+ '#svg_d1 svg { fill: #ff9800; } '+ '#svg_d2 svg { fill: #607d8b; } '+ '._2sLQpDcQ svg { transition: .2s; } '+ '._2sLQpDcQ:hover { opacity: 1; } '+ '._2sLQpDcQ:hover svg { fill: #fff !important; background: #2196f3; }'; } else if(amember){ css= '#ambHeader a:hover { text-decoration: none; } '+ '#ambHeader .-ameblo-cmnhf-icon { '+ 'width: auto !important; height: 17px !important; '+ 'margin: 0 4px 0 15px !important; padding: 2px 1px 3px 1px !important; '+ 'border: 1px solid #aaa; border-radius: 4px; '+ 'vertical-align: -8px !important; background-image: none !important; } '+ '#ambHeader .-ameblo-cmnhf-icon:before { '+ 'font: 24px/19px ameba-symbols; transition: .2s; } '+ '.-ameblo-cmnhf-mypage .-ameblo-cmnhf-icon:before { '+ 'content: "\\EA1e"; color: #009688; } '+ '.-ameblo-cmnhf-mypage:hover .-ameblo-cmnhf-icon { '+ 'background: #2196f3 !important; } '+ '.-ameblo-cmnhf-mypage:hover .-ameblo-cmnhf-icon:before { '+ 'color: #fff !important; } '+ '.-ameblo-cmnhf-pigg .-ameblo-cmnhf-icon:before { '+ 'content: "\\EA3b"; color: #ff9800; } '+ '.-ameblo-cmnhf-pigg:hover .-ameblo-cmnhf-icon { '+ 'background: #2196f3 !important; } '+ '.-ameblo-cmnhf-pigg:hover .-ameblo-cmnhf-icon:before { '+ 'color: #fff !important; } '+ '.-ameblo-cmnhf-blog .-ameblo-cmnhf-icon:before { '+ 'content: "\\EA31"; color: #607d8b; } '+ '.-ameblo-cmnhf-blog:hover .-ameblo-cmnhf-icon { '+ 'background: #2196f3 !important; } '+ '.-ameblo-cmnhf-blog:hover .-ameblo-cmnhf-icon:before { '+ 'color: #fff !important; }'; } let base=document.querySelector('body'); let style=document.createElement('style'); // ambHeader のアレンジ style.setAttribute("id", "aambh_style"); style.innerHTML=css; if(!base.querySelector('#aambh_style')){ base.appendChild(style); } toHome.addEventListener('click', function(event){ event.preventDefault(); if(event.shiftKey){ location.href='https://www.ameba.jp/'; } else{ if(document.referrer=='https://www.ameba.jp/'){ window.close(); } else{ window.location.href='https://www.ameba.jp/'; }}}); if(location.hash=='#cbox'){ // #cbox付きURLで開かれた場合 if(!document.querySelector('#aid_comm')){ document.documentElement.insertAdjacentHTML( 'beforeend', '<style id="aid_comm">'+ 'html { scroll-behavior: unset; } '+ 'body { zoom: unset !important; '+ 'transform: unset !important; width: unset !important; } '+ '.comm_wrapp { '+ 'position: fixed !important; z-index: 100 !important; '+ 'top: 60px; left: calc(50% - 360px); '+ 'width: 620px; margin: 0; padding:20px 60px 20px 40px !important; '+ 'max-height: 80vh; overflow-y: auto; color: #000; background: #fff; '+ 'border: 2px solid #aaa; box-shadow: 0 0 0 100vw rgb(0 0 0 / 25%); } '+ '.comm_wrapp *:not([data-uranus-icon]) '+ '{ font: 16px Meiryo; color: #000 !important; } '+ '.skin-bgQuiet, .skinStrongBgColor { background: #f6f8f9; } '+ '.skin-btnPrimary, .basicBtnS { background: #eceff1; } '+ '.skin-borderLoud, .skin-borderQuiet, '+ '.skinBorderHr, .skinBorderList li { border-color: #888; } '+ '#commentsHeader { margin-top: 0; } '+ '.comm_wrapp .clear_reset { position: absolute; top: 20px; right: 15px; '+ 'height: 26px; width: 26px; padding: 0 5px; cursor: pointer; } '+ '</style>'); } if(once==0){ let body_height=document.body.scrollHeight; window.scrollTo(0, body_height); once=1; } let cbox=document.querySelector('#cbox'); if(cbox){ // 新タイプスキン if(document.querySelector('[data-uranus-component="mainWidget"]')){ let cbox_wrapp=cbox.closest('[data-uranus-component="mainWidget"]'); cbox_wrapp.classList.add('comm_wrapp'); } // 旧タイプスキン else if(document.querySelector('.commentArea')){ document.querySelector('.commentArea').classList.add('comm_wrapp'); } // レトロタイプスキン else if(document.querySelector('#comment_module')){ document.querySelector('#comment_module').classList.add('comm_wrapp'); }} let commWrapp=document.querySelector('.comm_wrapp'); if(commWrapp){ if(!commWrapp.querySelector('.clear_reset')){ commWrapp.insertAdjacentHTML('beforeend', '<input type="button" class="clear_reset" value="✖">'); } let clear_reset=commWrapp.querySelector('.clear_reset'); if(clear_reset){ clear_reset.onclick=function(){ clear_reset.remove(); let aid_comm=document.querySelector('#aid_comm'); if(aid_comm){ aid_comm.remove(); } history.pushState('0', '0', location.href.replace(/#cbox/, '')); //「#cbox」を削除 }}} } // #cbox付きURLで開かれた場合 } // main() } // 通常のブログページ等 if(location.href=='https://www.ameba.jp/home'){ //「HOME」画面の場合 let target1=document.querySelector('head'); let monitor1=new MutationObserver(main); monitor1.observe(target1, { childList: true }); main(); function main(){ let blog_link=document.querySelector('.HomeBlogModule_BlogTitle_Link'); if(blog_link){ blog_link.setAttribute('target', '_blank'); } let lback=document.querySelector('.HomeBlogModule_LookBackEntry_Article'); if(lback){ lback.setAttribute('target', '_blank'); } let brank=document.querySelectorAll('.HomeBlogFeed_Article_BlogRanking_Link'); for(let k=0; k<brank.length; k++){ brank[k].setAttribute('target', '_blank'); } let trankt=document.querySelectorAll('.HomeBlogFeed_Article_TopicsRanking_Top3_Link'); for(let k=0; k<trankt.length; k++){ trankt[k].setAttribute('target', '_blank'); } let trank=document.querySelectorAll('.HomeBlogFeed_Article_TopicsRanking_Item_Link'); for(let k=0; k<trank.length; k++){ trank[k].setAttribute('target', '_blank'); } //「コメントした記事」のリンクを直接「コメント欄を開く」仕様に変更 add_hash_c(); let more_c=document.querySelector('.HomeBlogComment .Collection_ReadMore_Button'); if(more_c){ more_c.onclick=function(){ setTimeout(()=>{ add_hash_c(); }, 1000); }} function add_hash_c(){ let comm_link=document.querySelectorAll('.HomeBlogComment_Collection a'); for(let k=0; k<comm_link.length; k++){ let href=comm_link[k].getAttribute('href'); if(!href.match(/#cbox/)){ comm_link[k].setAttribute('href', href+'#cbox'); }}} //「スタッフブログ」のリンクを「Shift+Click」で直接「コメント欄を開く」 let stuff_link=document.querySelector('.PcModuleNotification_Link'); if(stuff_link){ stuff_link.onclick=function(event){ if(event.shiftKey){ event.preventDefault(); let href=stuff_link.getAttribute('href'); if(!href.match(/#cbox/)){ window.open(href+'#cbox', null, '_blank'); }}}} } // main() //「フォローフィード」のリンクを「Shift+Click」で直接「コメント欄を開く」 let target2=document.querySelector('.HomeChecklist'); let monitor2=new MutationObserver(add_hash_f); monitor2.observe(target2, {childList: true, subtree: true}); function add_hash_f(){ let comm_link=document.querySelectorAll('.HomeChecklist_Collection_Item a'); for(let k=0; k<comm_link.length; k++){ comm_link[k].onclick=function(event){ if(event.shiftKey){ event.preventDefault(); let href=comm_link[k].getAttribute('href'); if(!href.match(/#cbox/)){ window.open(href+'#cbox', null, '_blank'); }}}}} } //「HOME」画面の場合 if(location.href=='https://www.ameba.jp/notifications'){ //「お知らせ」画面の場合 let target3=document.querySelector('head'); let monitor3=new MutationObserver(add_hash_n); monitor3.observe(target3, { childList: true }); add_hash_n(); function add_hash_n(){ let notifi_link=document.querySelectorAll('.NotificationListItem'); for(let k=0; k<notifi_link.length; k++){ let href=notifi_link[k].getAttribute('href'); if(href.match(/comment-/) && !href.match(/#cbox/)){ //「コメント承認」のお知らせ notifi_link[k].setAttribute('href', href+'#cbox'); notifi_link[k].setAttribute('target', '_blank'); notifi_link[k].style.boxShadow='inset 8px 0px 0 0px #cfd8dc'; }}} } //「お知らせ」画面の場合
「Aid AmbH」最新版について
旧いバージョンの JavaScriptツールは、アメーバのページ構成の変更で動作しない場合があり、導入する場合は最新バージョンをお勧めします。
●「Aid AmbH」の最新バージョンへのリンクは、以下のページのリンクリストから探せます。