MAL Custom CSS Override - Working!!!

Replaces the anime/manga lists CSS styles on other users anime/manga lists with your own, or with an style of an user of your choice!

2021-02-20 기준 버전입니다. 최신 버전을 확인하세요.

  1. // ==UserScript==
  2. // @name MAL Custom CSS Override - Working!!!
  3. // @namespace MALCSSOverRider
  4. // @description Replaces the anime/manga lists CSS styles on other users anime/manga lists with your own, or with an style of an user of your choice!
  5. // @version 1.0.0.0
  6. // @match https://myanimelist.net/animelist/*
  7. // @match https://myanimelist.net/mangalist/*
  8. // @icon https://www.google.com/s2/favicons?domain=myanimelist.net
  9. // @grant GM_registerMenuCommand
  10. // @run-at document-end
  11. // @grant unsafeWindow
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // ==/UserScript==
  15.  
  16. var BackupedActualUserListStyle = document.querySelector("#custom-css").innerText; //Create a global variable to store the user actual list style css codes
  17. var CurrentListUserName = window.location.pathname.split('/')[2]; //Get the username on the current list url to use later
  18.  
  19. if (GM_getValue("Default_Style") === undefined && CurrentListUserName === unsafeWindow.window.MAL.USER_NAME) { //if the default style doesn't exist yet define it if the user is on his own list
  20. GM_setValue("Default_Style", document.querySelector("#custom-css").innerText); //Store the actual style of the script user
  21. alert('The Default Style to be used to override the style on the lists of other users has been set!\nNow the lists of other users will use your anime/manga list css Style!'); //Show an alert message
  22. } //Finishes the if condition
  23.  
  24. GM_registerMenuCommand("Use this List Style!", ChangeListStyle); //Adds an option to the menu
  25.  
  26. function ChangeListStyle() //Function to Change the List Style
  27. { //Starts the function ChangeListStyle
  28. GM_setValue("Default_Style", BackupedActualUserListStyle); //Store the actual style of the script user
  29. alert('The Default Style to be used to override the style on the lists of other users has been set!\nNow the lists of other users will have the Style that this user is using now!'); //Show an alert message
  30. } //Finishes the function ChangeListStyle
  31.  
  32. document.querySelector("#custom-css").innerText = GM_getValue("Default_Style"); //Replaces the actual list style with the default list style that was chosen to be used to override styles