JavDB-lists-mod

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

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 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!)

// ==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}`
        }
    }
})();