JavDB-lists-mod

修改Javdb的我的清单的打开方式

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         JavDB-lists-mod
// @namespace    zerobiubiu.top
// @description  修改Javdb的我的清单的打开方式
// @version      1.1
// @author       zerobiubiu
// @license      MIT
// @match        https://javdb.com/users/*lists
// @icon         https://javdb.com/favicon-32x32.png
// ==/UserScript==

(function () {
    'use strict';
    const last = location.pathname
        .split('/')
        .filter(Boolean)
        .at(-1)

    const ul = document.querySelector("#lists > ul")
    const lis = ul.children

    const isListsPage = last === 'lists'

    if (isListsPage) {
        lis[0].style.display = 'none'
    }

    for (let i = isListsPage ? 1 : 0; i < lis.length; i++) {
        const a = lis[i].querySelector("div.column.is-10 > a")
        a.target = "_blank"

        if (isListsPage) {
            const id = new URL(a.href).searchParams.get('id')
            a.href = `/lists/${id}`
        }
    }
})();