🏠 返回首頁 

Greasy Fork is available in English.

Add "MxJ" option to dropdown menu - MAL

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


Installer dette script?
  1. // ==UserScript==
  2. // @name Add "MxJ" option to dropdown menu - MAL
  3. // @namespace https://myanimelist.net/profile/kyoyatempest
  4. // @version 1.3
  5. // @description Adds "MxJ" option to MAL's dropdown menu. (for mobile and desktop)
  6. // @author kyoyacchi
  7. // @match https://myanimelist.net/*
  8. // @grant none
  9. // @run-at document-end
  10. // @license MIT
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. const optionLink = document.createElement('a');
  15. optionLink.href = 'https://mxj.myanimelist.net/about-me/';
  16. const optionIcon = document.createElement('i');
  17. optionIcon.classList.add('fas', 'fa-table-list');
  18. optionIcon.setAttribute('aria-hidden', 'true');
  19. optionLink.appendChild(optionIcon);
  20. optionLink.innerHTML += ' MxJ Settings';
  21. const option = document.createElement('li');
  22. option.appendChild(optionLink);
  23. const mdropdown = document.querySelector('.menu-list');
  24. const ddropdown = document.querySelector('.arrow_box.header-profile-dropdown.header-menu-dropdown > ul');
  25. if (mdropdown) {
  26. option.classList.add("link");
  27. mdropdown.appendChild(option);
  28. } else if (ddropdown) {
  29. const bookshelf = Array.from(ddropdown.children).find((child) => child.textContent.trim() === 'Bookshelf');
  30. if (bookshelf) {
  31. ddropdown.insertBefore(option, bookshelf.nextSibling);
  32. }
  33. }
  34. })();