Add "MxJ" option to dropdown menu - MAL

Adds "MxJ" option to MAL's dropdown menu. (for mobile and desktop)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Add "MxJ" option to dropdown menu - MAL
// @namespace    https://myanimelist.net/profile/kyoyatempest
// @version      1.3
// @description  Adds "MxJ" option to MAL's dropdown menu. (for mobile and desktop)
// @author       kyoyacchi
// @match        https://myanimelist.net/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const optionLink = document.createElement('a');
    optionLink.href = 'https://mxj.myanimelist.net/about-me/';



    const optionIcon = document.createElement('i');
    optionIcon.classList.add('fas', 'fa-table-list');
    optionIcon.setAttribute('aria-hidden', 'true');
  

    optionLink.appendChild(optionIcon);
    optionLink.innerHTML += ' MxJ Settings';

    const option = document.createElement('li');
    option.appendChild(optionLink);

    const mdropdown = document.querySelector('.menu-list');
    const ddropdown = document.querySelector('.arrow_box.header-profile-dropdown.header-menu-dropdown > ul');

    if (mdropdown) {
      option.classList.add("link");
        mdropdown.appendChild(option);
    } else if (ddropdown) {
        const bookshelf = Array.from(ddropdown.children).find((child) => child.textContent.trim() === 'Bookshelf');

        if (bookshelf) {
            ddropdown.insertBefore(option, bookshelf.nextSibling);
        }
    }
})();