MALFunction - "Fix" ERRORS on MAL

When MAL bugs showing ERROR messages or is blank and doesn't load the script reloads the page until MAL is successfully loaded...

当前为 2021-01-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         MALFunction - "Fix" ERRORS on MAL
// @namespace    MALFunction
// @version      1.0.4
// @description  When MAL bugs showing ERROR messages or is blank and doesn't load the script reloads the page until MAL is successfully loaded...
// @author       hacker
// @match        https://myanimelist.net/*
// @icon         https://www.google.com/s2/favicons?domain=myanimelist.net
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  if (document.querySelector("body").innerHTML.length < 3100 && document.body.innerText.search('Please click "Submit" to verify that you are not a bot.') === -1) {
    location.reload(); //Reloads the page
  }
  if (document.body.innerText.search('Please click "Submit" to verify that you are not a bot.') > -1) {
    document.querySelector("button.g-recaptcha").click(); //Auto click on the submit button
  }
  if (document.querySelector("title").innerText === "500 Internal Server Error" || document.querySelector("title").innerText === "504 Gateway Time-out" || document.querySelector("title").innerText === "ERROR: The request could not be satisfied") {
    location.reload(); //Reloads the page
  }

  var SpanElements = document.querySelectorAll("span"); //Get all span elements on the page
  for (var i = SpanElements.length; i--;) { //For every single span element
    if (SpanElements[i].style.fontSize !== undefined) { //Check if the element has the font-size css attribute
      if (parseInt(SpanElements[i].style.fontSize) > 1000) { //If the element has the font-size css attribute and the font-size css value is bigger than 1000%
        SpanElements[i].style.fontSize = '1000%'; //Change the span element font-size css attribute to be only 1000%
      } //Finishes the if condition
    } //Finishes the if condition
  } //Finishes the for condition

})();