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"

// ==UserScript==
// @name            DungeonsOfTheWell profile page: return the `Class levels` option in the menu
// @name:ru         Возвращение ссылки на страницу "Уровни классов" на странице профиля игры "Подземелья колодца"
// @namespace       http://tampermonkey.net/
// @version         2025-02-15
// @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
// @include         https://vip3.activeusers.ru/app.php*
// @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.");
}