Better MAL Favs

Choose how you want profile favorites to look like.

当前为 2021-12-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Better MAL Favs
  3. // @namespace https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
  4. // @version 0.2
  5. // @description Choose how you want profile favorites to look like.
  6. // @author hacker09
  7. // @match https://myanimelist.net/profile/*
  8. // @icon http://i.imgur.com/b7Fw8oH.png
  9. // @run-at document-end
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. document.head.insertAdjacentHTML('beforeend', '<style>.fav-slide-block .fav-slide .btn-fav {margin-right: 4px; width: 76px;}</style>'); //Make the default righ margin smaller
  16. document.head.insertAdjacentHTML('beforeend', '<style>.fav-slide-block .fav-slide .btn-fav .link.bg-center, .fav-slide-block .fav-slide .btn-fav .link img {width: inherit; object-fit: unset;}</style>'); //Make the favs and their images smaller
  17.  
  18. document.querySelectorAll(".fav-slide-block.mb12 > div.fav-slide-outer > ul").forEach(function(el) { //ForEach favs
  19. if (el.querySelectorAll('li').length <= 10) //Check if the row has no more than 10 favs
  20. { //Starts the if condition
  21. el.parentNode.parentNode.childNodes[3].remove(); //Delete the needless right fav slider
  22. } //Finishes the if condition
  23. }); //Finishes the foreach condition
  24. })();