Hide Entry Score

Hide the score on anime/manga on MAL as soon as the page loads. To see the entry store hover the mouse over the score.

目前為 2022-07-23 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Hide Entry Score
  3. // @namespace ScoreHider
  4. // @version 7
  5. // @description Hide the score on anime/manga on MAL as soon as the page loads. To see the entry store hover the mouse over the score.
  6. // @author hacker09
  7. // @include /^https:\/\/myanimelist\.net\/(anime|manga)(id=)?(\.php\?id=)?\/?\d+\/?(?!.*\/).*(\?q=.*&cat=anime|manga)?$/
  8. // @match https://myanimelist.net/stacks/*
  9. // @match https://myanimelist.net/topanime.php*
  10. // @match https://myanimelist.net/anime/season*
  11. // @match https://myanimelist.net/anime/genre/*
  12. // @match https://myanimelist.net/anime/producer/*
  13. // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://myanimelist.net&size=64
  14. // @run-at document-start
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. document.head.insertAdjacentHTML('beforeend', '<style>.score-label, .stars {display: none;}</style>'); //Hide the scores
  21.  
  22. if (location.href.match("genre") !== null) //If the user is on a genre page
  23. { //Starts the if condition
  24. document.head.insertAdjacentHTML('beforeend', '<style>tr > td.borderClass.ac.bgColor0:nth-child(5), tr > td.borderClass.ac.bgColor1:nth-child(5) {color: #ffffff00;}</style>'); //Hide the scores on genre pages
  25. document.head.insertAdjacentHTML('beforeend', '<style>td.borderClass.bgColor1.ac.fw-b:nth-child(5) {color: #1c439b;}</style>'); //Show the score column on genre pages
  26. } //Finishes the if condition
  27.  
  28. window.addEventListener("load", function() //Wait the window load
  29. { //Starts the load event listener
  30. if (document.querySelector("span[style*='color: #787878;']") !== null) //If the user is on a producer page with the List View enabled
  31. { //Starts the if condition
  32. document.querySelectorAll("span[style*='color: #787878;']").forEach(el => el.style.display = 'none'); //Hide the scores
  33. } //Finishes the if condition
  34.  
  35. document.querySelectorAll("div.fl-l.score,.js-statistics-info,td.score.ac,td.your-score.ac,.scormem,.widget,.icon-people-score-star,td.borderClass.bgColor1.ac.fw-b:nth-child(5)").forEach(function(el) { //Starts a for loop
  36. el.onmousemove = async function() { //Creates a new function to run when the mouse is hovering the score
  37. if (document.querySelector(".icon-people-score-star") !== null) //If the user is on a producer page with the List View enabled
  38. { //Starts the if condition
  39. document.querySelectorAll("span[style*='color: rgb(120, 120, 120);']").forEach(el => el.style.display = 'contents'); //Show the scores
  40. } //Finishes the if condition
  41. else //If the user is not on a producer page with the List View enabled
  42. { //Starts the else condition
  43. document.querySelectorAll(".score-label, .stars").forEach(el => el.style.display = 'contents'); //Show the scores
  44.  
  45. if (location.href.match("genre") !== null) //If the user is on a genre page
  46. { //Starts the if condition
  47. document.head.insertAdjacentHTML('beforeend', '<style>tr > td.borderClass.ac.bgColor0:nth-child(5), tr > td.borderClass.ac.bgColor1:nth-child(5) {color: black;}</style>'); //Hide the scores on genre pages
  48. } //Finishes the if condition
  49.  
  50. } //Finishes the else condition
  51. }; //Finishes the onmousemove event listener
  52. }); //Finishes the for loop
  53. }); //Finishes the load event listener
  54. })();