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-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name MALFunction - "Fix" ERRORS on MAL
  3. // @namespace MALFunction
  4. // @version 1.0.0
  5. // @description When MAL bugs showing ERROR messages or is blank and doesn't load the script reloads the page until MAL is successfully loaded...
  6. // @author hacker
  7. // @match https://myanimelist.net/*
  8. // @icon https://www.google.com/s2/favicons?domain=myanimelist.net
  9. // @run-at document-end
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. if (document.querySelector("body").innerHTML.length < 4000)
  16. {
  17. location.reload(); //Reloads the page
  18. }
  19. 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")
  20. {
  21. location.reload(); //Reloads the page
  22. }
  23. })();