「ハイライト表示」の「ユーザーID」の設定 

アメーバランキングページのアレンジスタイル「Ameblo Rankings Viewer Ⅱ」を先日に更新しましたが、更新の主な部分は「プリプロセッサー」によるオプション機能の導入でした。 これにより、ユーザーがCSSコードを触らずに、「設定メニュー」からアレンジスタイルのカスタマイズが可能になります。

 

しかし、最も「設定メニュー」に入れたかったのは「ハイライト表示」の「ユーザーID」の設定でした。 ハイライト機能は、自分のランキングの確認には必須です。

 

しかし、「 a[href*="User-ID"] 」の属性セレクタを利用してハイライトを実現しているので、「プリプロセッサー」でこの「User-ID」を扱う事ができません。 扱えるのは「プロパティ値」だけで、「セレクタ」は対象外なのです。

 

そうなると、ユーザーがコードを触らずに「ハイライト機能」を利用できる方法は、「ユーザーID」の設定メニューのインターフェイスをJavaScriptで自製するしかありません。

 

このメニューを独立したツールとして作る事はできますが、規模が小さ過ぎます。 そこですぐに思い着いたのは、「Ameblo Rankings Viewer Ⅱ」のコンパニオンツールともいえる「Ranking Blocker」に、「ハイライト機能」を持たせる事でした。

 

 

 

 「Ranking Blocker」のファイルメニューを開いて設定

「Ranking Blocker」は、ブロック対象の登録データを「ファイル保存」「ファイルから読込み」する「ファイルメニュー」を備えていますが、これに「ハイライト機能」の「ユーザーID」を設定する入力枠を追加しました。

 

▪ランキングページで、ヘッダー左端の「Amebaロゴ」を「Ctrl+左Click」すると、画面の最上部に下の様な「ファイルメニュー」が表示されます。

 

「ユーザーID」の設定枠は、このメニューの右端に設置しています。

 

 

「設定枠」で指定したIDのユーザーの記事は、「赤」で明瞭に「ハイライト表示」されます。 

 

▪基本的には、ユーザー自身の「ユーザーID」を指定しますが、自分以外のユーザーのIDを指定して、そのユーザーの記事をハイライトする事も可能です。

 

▪指定したIDは、ローカルストレージに登録され、書き換えるまで維持されます。

 

▪「ハイライト表示」を指定できる「ユーザーID」は 1個だけですが、何度でも変更が可能です。

 

 

 

「ユーザーID」の設定操作 

下は、「ユーザーID」の設定部です。

 

 

ユーザーID入力枠」の初期値は「tmp2」、もしくは「Ameba-ID」です。 これまでのバージョンでこのツールでファイル保存をしていると「tmp2」で、このツールを初めて使用した場合は「Ameba-ID」になります。

 

▪「入力枠」は、現在「ハイライト表示」を設定している「ID」を表示します。

 

▪ここへの記入は、アメブロの「ユーザーID」を正確に記入するのがベストです。

上の例で「personwritep」は正しい「ユーザーID」ですが、「person」の設定でも部分一致でハイライト表示します。 しかし、「personal」などの別ユーザーにもヒットする可能性が出て来ます。

 

に記入して Set」を「左Click」します。 この操作で初めて登録されます。

 

▪下の様に入力枠が 1sec ライトグリーンになり、登録された事を示します。

 

 

▪リストにこのユーザーIDの記事があれば、登録と同時にハイライト表示されます。

 

 

 

タイル型リストでのハイライト表示 

特定のジャンルでは、掲載画像を表に出したタイル型リストが使われています。 この様なリストでも、「ハイライト表示」は有効です。

 

 

 

 

(注)「Ranking Blocker」は、オフィシャルブログ(芸能人ブログ)のランキングでは動作しません。

 

 

 

 「Ranking Blocker」の使い方 

以下のページに操作マニュアルを纏めています。

 

 

 

 

 「Ranking Blocker」を利用するには

「Ranking Blocker」は Chrome / Edge / Firefox のブラウザ上で動作します。

このツールは、「Ameblo Rankings Viewer Ⅱ」というスタイルでアレンジしたランキングページ上で動作し、このアレンジは必須です。 以下に、ページアレンジとスクリプト導入の環境設定の手順を説明します。

 

 

 

(A) 拡張機能「Stylus」と「Ameblo Rankings Viewer Ⅱ」の入手 

 

A-❶ 拡張機能「Stylus」の導入 

「Ameblo Rankings Viewer Ⅱ」のアレンジを実現するには、使用されているブラウザに拡張機能「Stylus」を導入する必要があります。(既にこの拡張機能を導入している場合は、A-❶の手順は不要です)

拡張機能「Stylus」を導入する手順は、以下のリンクを参照ください。 (新EdgeはChrome版が使えます)

 

 

 

A-❷「Ameblo Rankings Viewer Ⅱ」の入手 

「Ameblo Rankings ViewerⅡ」は、以下のページから入手できます。

 

 

このリンク先は、下の様なページです。

 

 

サンプル画像の下の install ボタンを押します。

 

この操作で「Stylus」のインストール画面が表示されます。 下の画面の左上にある「インストール {S}」のボタンをもう一度押します。

 

 

「スタイルがインストー­ルされています」と表示されたら、この画面を閉じます。 以上で「Ameblo Rankings ViewerⅡ」のインストールが完了です。

 

 

 

(B) 拡張機能「Tampermonkey」と「Ranking Blocker」の導入 

 

B-❶ 拡張機能「Tampermonkey」の導入

「Tampermonkey」は、使用しているブラウザに適した版を導入する必要があります。(既にこの拡張機能を導入している場合は、B-❶の手順は不要です)

「Tampermonkey」の導入手順は、以下のページを参照ください。

 

 

B-❷「Ranking Blocker」のインストール 

●「Tampermonkey」の「」マークの「新規スクリプト」タブを開きます。

 

 

 

●「新規スクリプト」には、最初からテンプレートが記入されています。 これは全て削除して、完全に空白の編集枠に 下のコードをコピー&ペーストします。

 

〔コピー方法〕 軽量シンプルなツール「PreBox Button   」を使うと

  コード枠内を「Ctrl+左Click」➔「Copy code 」を「左Click」

  の操作で、掲載コードのコピーが可能になります。

 

● 最後に「ファイル」メニューの「保存」を押すと、ツールが使用可能になります。

 

●「Ranking Blocker」の旧バージョンがある場合は、削除してください。

 

 

〔 Ranking Blocker 〕ver. 1.3

 

// ==UserScript==
// @name         Ranking Blocker
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  不要なランキングノミネートの非表示
// @author       Ameba Blog User
// @match        https://blogger.ameba.jp/genres/*
// @match        https://blogger.ameba.jp/hashtags/*
// @match        https://blogger.ameba.jp/ranking/*
// ==/UserScript==


let ua=0;
let agent = window.navigator.userAgent.toLowerCase();
if(agent.indexOf('firefox') > -1){ ua=1; }


let rb_style=
    '<style class="RB_style">'+
    '.-ameblo-cmnhf-logo { width: 66px; padding-left: 7px; cursor: pointer; '+
    'outline: #028d9f solid 1px; outline-offset: -2px; border-radius: 3px; }'+
    '.-ameblo-cmnhf-logo a { pointer-events: none; }'+
    '.RB_sw { position: absolute; top: 4px; left: -40px; font: bold 10px Meiryo; '+
    'padding: 5px 2px 4px; border: 1px solid #aaa; background: #fff; '+
    'cursor: pointer; display: none; }'+
    '.RB_sw.B:hover { color: red; }'+
    '.RB_sw.U:hover { color: #26c6da; }'+
    '.RB_item:hover .RB_sw { display: block; }'+
    '</style>';

if(document.querySelector('.RB_style')){
    document.querySelector('.RB_style').remove(); }
document.body.insertAdjacentHTML('beforeend', rb_style);



let block_id=[];
let read_json=localStorage.getItem('RankingBlock_ID'); // ローカルストレージ保存名
block_id=JSON.parse(read_json);
if(block_id==null){ block_id=['tmp1','%Ameba-ID']; }
let block_filter=block_id.join('|');
let block_regex=RegExp(block_filter);

let edit_mode; // Ranking Blocker の動作モード
edit_mode=localStorage.getItem('RankingBlock_mode'); // ローカルストレージ保存名
if(edit_mode!=0 && edit_mode!=1){
    edit_mode=0;
    localStorage.setItem('RankingBlock_mode', 0); } // edit_mode 初期値「0」


neo_pager();



let retry=0;
let interval=setInterval(wait_target, 100);
function wait_target(){
    retry++;
    if(retry>10){ // リトライ制限 10回 1sec
        clearInterval(interval); }
    let target=document.querySelector('.-ameblo-cmnhf-logo a'); // 監視 target
    if(target){
        clearInterval(interval);
        setter(); }}

function setter(){
    let logo_sw=document.querySelector('.-ameblo-cmnhf-logo');
    if(edit_mode==0){
        logo_sw.style.outlineColor='#028d9f';
        logo_sw.style.background='#fff'; }
    else{
        logo_sw.style.outlineColor='#fff';
        logo_sw.style.background='red'; }

    logo_sw.addEventListener('click', function(event){
        event.preventDefault();
        if (event.ctrlKey==true){
            menu(); }
        else{
            emode_set(); }}, false);
} // setter()



function menu(){
    let inner=
        '<div id="rankb">'+
        '<input id="button0" type="submit" value="✖ 閉じる">'+
        '<input id="button1" type="submit" value="ブロックデータを保存">'+
        '<input id="button2" type="file">'+
        '<input id="id_box" type="text">'+
        '<input id="button3" type="submit" value="Set">'+
        '<style>'+
        '#rankb { position: fixed; top: 0; left: 0; font-size: 14px; width: 100%; '+
        'padding: 0 25px; box-sizing: border-box; background: #82bddc; }'+
        '#rankb input { font: normal 14px/24px Meiryo; }';

    if(ua==0){
        inner+=
            '#button0, #button3 { padding: 2px 6px 0; margin: 9px 0; }'+
            '#button1 { padding: 2px 8px 0; margin: 9px 0 9px 40px; }'+
            '#button2 { margin: 9px 20px 9px 40px; width: 280px; }'+
            '#id_box { height: 23px; width: 200px; padding: 0 6px; }'; }

    if(ua==1){
        inner+=
            '#button0, #button3 { padding: 0 6px; margin: 9px 0; height: 27px; }'+
            '#button1 { padding: 0 8px; margin: 9px 0 9px 40px; height: 27px; }'+
            '#button2 { margin: 9px 20px 9px 40px; width: 280px; }'+
            '#id_box { height: 23px; width: 200px; padding: 0 6px; }'; }

    inner+='</style></div>';

    if(!document.querySelector('#rankb')){
        document.body.insertAdjacentHTML('beforeend', inner); }

    let rankb=document.querySelector('#rankb');
    if(rankb){
        let button0=document.querySelector('#button0');
        if(button0){
            button0.onclick=function(){
                rankb.remove(); }}

        let button1=document.querySelector('#button1');
        if(button1){
            button1.onclick=function(){
                let write_json=JSON.stringify(block_id);
                let blob=new Blob([write_json], {type: 'application/json'});
                let a=document.createElement("a");
                a.href=URL.createObjectURL(blob);
                document.body.appendChild(a);
                a.download='ranking_bl.json';
                a.click();
                document.body.removeChild(a);
                URL.revokeObjectURL(a.href); }}


        let button2=document.querySelector('#button2');
        if(button2){
            button2.addEventListener("change" , function(){
                if(!(button2.value)) return; // ファイルが選択されない場合
                let file_list=button2.files;
                if(!file_list) return; // ファイルリストが選択されない場合
                let file=file_list[0];
                if(!file) return; // ファイルが無い場合

                let file_reader=new FileReader();
                file_reader.readAsText(file);
                file_reader.onload=function(){
                    if(file_reader.result.slice(0, 7)=='["tmp1"'){ // ranking_bl.jsonの確認
                        block_id=JSON.parse(file_reader.result);
                        let write_json=JSON.stringify(block_id);
                        localStorage.setItem('RankingBlock_ID', write_json); // ストレージ保存名
                        location.reload(); }}; }); }


        let id_box=document.querySelector('#id_box');
        let button3=document.querySelector('#button3');
        if(id_box && button3){
            let ameba_id=block_id[1];
            ameba_id=ameba_id.replace('%', '');
            id_box.value=ameba_id;

            button3.onclick=function(){
                block_id[1]='%'+ id_box.value;
                let write_json=JSON.stringify(block_id);
                localStorage.setItem('RankingBlock_ID', write_json); // ストレージ保存名
                id_box.style.background='#bdfff9';
                setTimeout(()=>{
                    id_box.style.background='';
                    hiliter();
                }, 1000); }}

    }
} // menu()



function emode_set(){
    let logo_sw=document.querySelector('.-ameblo-cmnhf-logo');
    if(edit_mode==0){
        edit_mode=1;
        localStorage.setItem('RankingBlock_mode', 1);
        logo_sw.style.outlineColor='#fff';
        logo_sw.style.background='red';
        blocker(); }
    else if(edit_mode==1){
        edit_mode=0;
        localStorage.setItem('RankingBlock_mode', 0);
        logo_sw.style.outlineColor='#028d9f';
        logo_sw.style.background='#fff';
        blocker(); }}




let target0=document.querySelector('.l-container'); // 監視 target
let monitor0=new MutationObserver(neo_pager);
monitor0.observe(target0, {childList: true, subtree: true}); // リストページ更新の監視開始

function neo_pager(){
    if(location.pathname.includes('blogs/ranking') || // 総合ブログ
       location.pathname.includes('entries/ranking') || // 記事
       location.pathname.includes('ranking/monthly') || // 全体(月間)
       location.pathname.includes('ranking/daily')){ // 全体(デイリー)


        let help_url='https://ameblo.jp/personwritep/entry-12757564496.html';

        let help_SVG=
            '<svg class="help_rb" viewBox="0 0 210 220">'+
            '<path d="M89 22C71 25 54 33 41 46C7 81 11 142 50 171C58 177 '+
            '68 182 78 185C90 188 103 189 115 187C126 185 137 181 146 175'+
            'C155 169 163 162 169 153C190 123 189 80 166 52C147 30 118 18'+
            ' 89 22z" style="fill:#000;"></path>'+
            '<path d="M67 77C73 75 78 72 84 70C94 66 114 67 109 83C106 91'+
            ' 98 95 93 101C86 109 83 116 83 126L111 126C112 114 122 108 1'+
            '29 100C137 90 141 76 135 64C127 45 101 45 84 48C80 49 71 50 '+
            '68 54C67 56 67 59 67 61L67 77M85 143L85 166L110 166L110 143L'+
            '85 143z" style="fill:#fff;"></path>'+
            '</svg>';

        let pager=
            '<input id="input_page" type="number" autofocus="" min="0" step="20">'+
            '<a href="'+ help_url +'" target="_blank" rel="noopener">'+ help_SVG +'</a>'+
            '<style>'+
            '#input_page { position: absolute; top: 2px; right: 40px; '+
            'font: bold 16px Meiryo; padding: 2px 0 0 12px; width: 70px; height: 19px; }'+
            '.help_rb { position: absolute; right: 12px; top: 3px; '+
            'height: 24px; width: 24px; cursor: pointer; } '+
            '</style>';

        let ambHeader=document.querySelector('#ambHeader');
        if(!document.querySelector('#input_page')){
            ambHeader.insertAdjacentHTML('beforeend', pager); }

        let input_page=document.querySelector('#input_page');

        let wurl=window.location.search; // クエリー文字列から現在のページを取得
        let q=0;
        if(wurl){
            let query=wurl.split('&');
            for(let k=0; k<query.length; k++){
                if(query[k].includes('rank=')){ // 総合ブログ・全体(月間)・全体(デイリー)
                    q=query[k].replace(/[^0-9]/g, ''); }
                if(query[k].includes('offset=')){ // 記事
                    q=query[k].replace(/[^0-9]/g, ''); }}}

        input_page.value=q;

        document.onkeydown=function(event){
            if(event.keyCode==38){ // 「⇧」キーを取得
                event.preventDefault();
                input_page.stepUp(1); }
            if(event.keyCode==40){ // 「⇩」キーを取得
                event.preventDefault();
                input_page.stepDown(1); }}


        if(location.pathname.includes('blogs/ranking') || // 総合ブログ
           location.pathname.includes('ranking/monthly') || // 全体(月間)
           location.pathname.includes('ranking/daily')){ // 全体(デイリー)
            document.addEventListener('keydown', function(event){
                if(event.keyCode==13){
                    event.preventDefault();
                    let jump_url=window.location.href.split('?')[0]+
                        '?rank='+input_page.value+'&amebaId='+input_page.value;
                    window.location.href=jump_url; }}); }


        if(location.pathname.includes('entries/ranking')){ // 記事
            document.addEventListener('keydown', function(event){
                if(event.keyCode==13){
                    event.preventDefault();
                    let jump_url=window.location.href.split('?')[0]+
                        '?offset='+input_page.value+'&amebaId=0&entryId=0';
                    window.location.href=jump_url; }}); }

    } // 総合ブログ・記事・全体(月間)・全体(デイリー)の場合

    else{ // ハッシュタグ・新着の場合
        let input_page=document.querySelector('#input_page');
        if(input_page){
            input_page.remove(); }}


    let gootag=document.querySelectorAll('#ambFooter ~ script'); // 不良要素削除
    for(let k=0; k<gootag.length; k++){
        if(gootag[k].textContent.includes('google_tag_manager')){
            gootag[k].remove(); }}

    let gooimg=document.querySelectorAll('#ambFooter ~ img[src*="ln.ameba.jp/v2/ra"]');
    for(let k=0; k<gooimg.length; k++){
        gooimg[k].remove(); }

} // neo_pager()




let target1=document.querySelector('.l-container'); // 監視 target
let monitor1=new MutationObserver(blocker);
monitor1.observe(target1, {childList: true, subtree: true}); // リストページ更新監視開始

blocker();

function blocker(){
    let k;
    let user_href=[];
    let user_a=[];
    let user_id=[];
    let send;


    if(location.pathname.includes('genres/') || // 総合ブログ・記事・新着記事
       location.pathname.includes('hashtags/')){ // ハッシュタグ

        let g_nav=document.querySelectorAll('.c-genreGlobalNav__item');

        if(g_nav[1].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemA=document.querySelectorAll('.p-rankingAllText__item');
            for(k=0; k<rank_itemA.length; k++){
                user_a[k]=rank_itemA[k].querySelector('.p-rankingAllText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                block_item(rank_itemA[k], user_href[k]);}} // 総合ブログ


        if(g_nav[2].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemT=document.querySelectorAll('.p-rankingTodayText__item');
            for(k=0; k<rank_itemT.length; k++){
                user_a[k]=rank_itemT[k].querySelector('.p-rankingTodayText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                block_item(rank_itemT[k], user_href[k]); }} // 記事


        if(g_nav[3].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemH=document.querySelectorAll('.p-hashtagEntryRanking__item');
            for(k=0; k<rank_itemH.length; k++){
                user_a[k]=rank_itemH[k].querySelector('.p-hashtagEntryRanking__user a');
                user_href[k]=user_a[k].getAttribute('href');
                block_item(rank_itemH[k], user_href[k]); }} // ハッシュタグ


        if(g_nav[4].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemR=document.querySelectorAll('.p-recentEntryText__item');
            for(k=0; k<rank_itemR.length; k++){
                user_a[k]=rank_itemR[k].querySelector('.p-recentEntryText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                block_item(rank_itemR[k], user_href[k]); }}} // 新着記事


    if(location.pathname.includes('ranking/monthly') || // 全体(月間)
       location.pathname.includes('ranking/daily')){ // 全体(デイリー)
        let rank_itemA=document.querySelectorAll('.p-rankingAllText__item');
        for(k=0; k<rank_itemA.length; k++){
            user_a[k]=rank_itemA[k].querySelector('.p-rankingAllText__user a');
            user_href[k]=user_a[k].getAttribute('href');
            block_item(rank_itemA[k], user_href[k]);}}



    function block_item(item, user_href){
        if(block_regex.test(user_href)==true){
            if(edit_mode==0){
                item.style.visibility='hidden'; }
            if(edit_mode==1){
                item.style.visibility='visible';
                item.style.background='#a9c1cf'; }}}


    hiliter();

} // blocker




function hiliter(){
    let ameba_id=block_id[1]; // block_id=['tmp1', '%Ameba-ID', 'xxxxxx', ]
    ameba_id=ameba_id.replace('%', '');

    let am_style=
        '<style class="AM_style">'+
        '.p-rankingAllText__title a[href*="'+ ameba_id +'"], '+
        '.p-rankingTodayText__blogName a[href*="'+ ameba_id +'"], '+
        '.p-hashtagEntryRanking__blogName > a[href*="'+ ameba_id +'"], '+
        '.p-recentEntryText__blogName a[href*="'+ ameba_id +'"], '+
        '.p-rankingAllImage__title a[href*="'+ ameba_id +'"], '+
        '.p-rankingTodayImage__title a[href*="'+ ameba_id +'"], '+
        '.p-recentEntryImage__title a[href*="'+ ameba_id +'"] { '+
        'color: #fff !important; background: red; }'+
        '</style>';

    if(document.querySelector('.AM_style')){
        document.querySelector('.AM_style').remove(); }
    document.body.insertAdjacentHTML('beforeend', am_style); }




let target2=document.querySelector('.l-container'); // 監視 target
let monitor2=new MutationObserver(checker);
monitor2.observe(target2, {childList: true, subtree: true}); // リストページ更新の監視開始

checker();

function checker(){
    let k;
    let user_href=[];
    let user_a=[];
    let user_aH=[];
    let user_id=[];


    if(location.pathname.includes('genres/') || // 総合ブログ・記事・新着記事
       location.pathname.includes('hashtags/')){ // ハッシュタグ

        let g_nav=document.querySelectorAll('.c-genreGlobalNav__item');

        if(g_nav[1].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemA=document.querySelectorAll('.p-rankingAllText__item');
            for(k=0; k<rank_itemA.length; k++){
                user_a[k]=rank_itemA[k].querySelector('.p-rankingAllText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                check_item(rank_itemA[k], user_href[k]); }} // 総合ブログ


        if(g_nav[2].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemT=document.querySelectorAll('.p-rankingTodayText__item');
            for(k=0; k<rank_itemT.length; k++){
                user_a[k]=rank_itemT[k].querySelector('.p-rankingTodayText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                check_item(rank_itemT[k], user_href[k]); }} //  記事


        if(g_nav[3].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemH=document.querySelectorAll('.p-hashtagEntryRanking__item');
            for(k=0; k<rank_itemH.length; k++){
                user_a[k]=rank_itemH[k].querySelector('.p-hashtagEntryRanking__user a');
                user_aH[k]= // URL取得先
                    rank_itemH[k].querySelector('.p-hashtagEntryRanking__blogName>a');
                user_href[k]=user_aH[k].getAttribute('href');
                check_item(rank_itemH[k], user_href[k]); }} // ハッシュタグ


        if(g_nav[4].classList.contains('c-genreGlobalNav__item--active')==true){
            let rank_itemR=document.querySelectorAll('.p-recentEntryText__item');
            for(k=0; k<rank_itemR.length; k++){
                user_a[k]=rank_itemR[k].querySelector('.p-recentEntryText__user a');
                user_href[k]=user_a[k].getAttribute('href');
                check_item(rank_itemR[k], user_href[k]); }}} // 新着記事


    if(location.pathname.includes('ranking/monthly') || // 全体(月間)
       location.pathname.includes('ranking/daily')){ // 全体(デイリー)
        let rank_itemA=document.querySelectorAll('.p-rankingAllText__item');
        for(k=0; k<rank_itemA.length; k++){
            user_a[k]=rank_itemA[k].querySelector('.p-rankingAllText__user a');
            user_href[k]=user_a[k].getAttribute('href');
            check_item(rank_itemA[k], user_href[k]); }}


    function check_item(item, user_href){
        item.classList.add('RB_item');
        let sw;
        if(block_regex.test(user_href)==false){
            sw='<div class="RB_sw B">Block</div>'; }
        else{
            sw='<div class="RB_sw U">Unset</div>'; }
        if(!item.querySelector('.RB_sw')){
            item.insertAdjacentHTML('beforeend', sw); }

        let RB_sw=item.querySelector('.RB_sw');
        RB_sw.onclick=function(event){
            event.preventDefault();
            local_backup(user_href); }}


    function local_backup(user_href){
        if(block_regex.test(user_href)!=true){
            let ok=confirm(" ⛔  ブロックリストに登録しますか?");
            if(ok){
                let user_id=user_href.replace('https://ameblo.jp/', '');
                user_id=user_id.replace(/\//g, '');
                block_id.push(user_id);
                let write_json=JSON.stringify(block_id);
                localStorage.setItem('RankingBlock_ID', write_json); // ストレージ保存名
                location.reload(); }}
        if(block_regex.test(user_href)==true){
            let ok=confirm(" 🟢  ブロックリストから外し表示させますか?");
            if(ok){
                let user_id=user_href.replace('https://ameblo.jp/', '');
                user_id=user_id.replace(/\//g, '');
                block_id=block_id.filter( function(item){
                    return item !==user_id; });
                let write_json=JSON.stringify(block_id);
                localStorage.setItem('RankingBlock_ID', write_json); // ストレージ保存名
                location.reload(); }}}

} // checker



 

 

 

「Ranking Blocker」最新版について 

旧いバージョンの JavaScriptツールは、アメーバのページ構成の変更で動作しない場合があり、導入する場合は最新バージョンをお勧めします。

 

●「Ranking Blocker」の最新バージョンへのリンクは、以下のページのリンクリストから探せます。