filterSuperfluousOnDMM

DMM・FANZAの通販商品一覧からアウトレット、限定版、および BOD/DOD を除去

נכון ליום 30-05-2020. ראה הגרסה האחרונה.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

/* jshint esversion: 6 */
// ==UserScript==
// @name         filterSuperfluousOnDMM
// @namespace    https://greasyfork.org/ja/users/289387-unagionunagi
// @version      0.2
// @description  DMM・FANZAの通販商品一覧からアウトレット、限定版、および BOD/DOD を除去
// @author       unagiOnUnagi
// @include      /^https?://\w+\.dmm\.co(m|\.jp)/mono/(\w+/)?-/(list|search)/.*$/
// @grant        GPL-2.0-or-later
// ==/UserScript==

(function() {
    'use strict';
    // アウトレット、限定版、BOD/DOD を一覧から削除
    let ul = document.getElementById('list') ;
    let nof = 0;
    ul.querySelectorAll('li').forEach(li => {
        let title = li.querySelector('div p.tmb a span img').getAttribute('alt');
        if ( /^【[^】]*アウトレット】/.test(title) ||
            /^【[^】]*限定】/.test(title) ||
            /([BD]OD)$/.test(title)
            ) {
            ul.removeChild(li);
            nof += 1;
        }
    });

    if (!ul.childElementCount) {
        // ページ内全作品がフィルターされていたらその旨表示
        ul.insertAdjacentHTML('afterbegin', '<b>ページ内の全作品がフィルターされています。(filterSuperfluousOnDMM)</b>');
    }

    // フィルター稼働中インジケーター
    let lastSpan = (document.querySelectorAll('p.headwithelem span span:last-child')[0] ||
                    document.querySelectorAll('p.headwithelem span:last-child')[0]);
    lastSpan.innerHTML = lastSpan.innerHTML.trim() + `<span title="アウトレット、限定版、BOD/DOD はフィルターしています (このページに ${nof} 個)">*</span>`
    // lastSpan.insertAdjacentHTML('afterend', `<span title="アウトレット、限定版、BOD/DOD はフィルターしています (このページに ${nof} 個)">*</span>`);

})();