DungeonsOfTheWell profile page: return the `Class levels` option in the menu

Adds a link to the page with id=621 in the drop-down list of the "Journal" menu item on the profile page of the game "Dungeons of the Well"

目前為 2025-08-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            DungeonsOfTheWell profile page: return the `Class levels` option in the menu
// @name:ru         Возвращение ссылки на страницу "Уровни классов" на странице профиля игры "Подземелья колодца"
// @namespace       http://tampermonkey.net/
// @version         2025-08-03
// @description     Adds a link to the page with id=621 in the drop-down list of the "Journal" menu item on the profile page of the game "Dungeons of the Well"
// @description:ru  Добавляет ссылку на страницу с id=621 в выпадающем списке пункта меню "Журнал" на странице профиля игры "Подземелья колодца"
// @author          rick_headle
// @match           https://vip3well.activeusers.ru/app.php*
// @match           https://welldungeon.online/*
// @icon            none
// @grant           none
// @license         MIT
// ==/UserScript==

// Get the first link in the list
const existingLinkElement = document.querySelector("#m_page a");
if (existingLinkElement) {
    const existingLink = existingLinkElement.href;

    // Modify the existing link to have id=621
    const newLink = existingLink.replace(/id=\d+/, "id=621");

    // Create a new list item with the modified link and title
    const newListElement = document.createElement("li");
    newListElement.innerHTML = `
        <a href="${newLink}" title="Уровни классов" role="menuitem">
            <i class="fa fa-bars"></i>
            <span class=""> Уровни классов</span>
        </a>
    `;

    // Append the new list item to the existing list
    document.querySelector("#m_page").parentNode.appendChild(newListElement);
} else {
    console.log("No link found in the list.");
}