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!

Устаревшая версия за 21.02.2021. Перейдите к последней версии.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

// ==UserScript==
// @name        MAL Custom CSS Override - Working!!!
// @namespace   MALCSSOverRider
// @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!
// @version     1.0.0.3
// @match       https://myanimelist.net/animelist/*
// @match       https://myanimelist.net/mangalist/*
// @icon        https://www.google.com/s2/favicons?domain=myanimelist.net
// @grant       GM_registerMenuCommand
// @run-at      document-end
// @grant       GM_setValue
// @grant       GM_getValue
// ==/UserScript==

var BackupedActualUserCustomListStyle = document.querySelector("#custom-css").innerText; //Create a global variable to store the user actual custom list style css codes
var BackupedActualUserListStyle = document.querySelector("style[type*='text/css']").innerText; //Create a global variable to store the user actual list style css codes

GM_registerMenuCommand("Use this List Style!", ChangeListStyle); //Adds an option to the menu

function ChangeListStyle() //Function to Change the List Style
{ //Starts the function ChangeListStyle

  document.querySelector("#custom-css").innerText = BackupedActualUserCustomListStyle; //Shows the actual user list custom style
  document.querySelector("style[type*='text/css']").innerText = BackupedActualUserListStyle; //Shows the actual user list style

  setTimeout(function() {
    if (confirm("Press OK if you want to use the Style you're seeing now on any anime and manga lists on MAL.")) //Show the confimation alert box text
    { //Starts the if condition
      GM_setValue("Default_Custom_Style", BackupedActualUserCustomListStyle); //Store the actual custom style of the script user
      GM_setValue("Default_Style", BackupedActualUserListStyle); //Store the actual style of the script user
    } //Finishes the if condition
    else //If the user pressed cancel
    { //Starts the else condition
      document.querySelector("#custom-css").innerText = GM_getValue("Default_Custom_Style"); //Shows the default override user list custom style
      document.querySelector("style[type*='text/css']").innerText = GM_getValue("Default_Style"); //Shows the default override user list style
    } //Finishes the else condition
  }, 500); //Shows an alert message
} //Finishes the function ChangeListStyle

document.querySelector("#custom-css").innerText = GM_getValue("Default_Custom_Style"); //Replaces the actual list custom style with the default list style that was chosen to be used to override styles
document.querySelector("style[type*='text/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