MyAnimeList - filter badges from first to latest

Filters badges from first to latest instead of latest to first.

  1. // ==UserScript==
  2. // @name MyAnimeList - filter badges from first to latest
  3. // @namespace http://myanimelist.net/profile/kyoyatempest
  4. // @version 1.1
  5. // @description Filters badges from first to latest instead of latest to first.
  6. // @author kyoyacchi
  7. // @match https://myanimelist.net/profile/*
  8. // @grant none
  9. // @icon https://myanimelist.net/favicon.ico
  10. // @license gpl3.0
  11. // ==/UserScript==
  12. function Apply () {
  13. try {
  14. let parent = document.getElementById('badges');
  15. if (!parent) return
  16. let arr = Array.from(parent.childNodes);
  17. arr = arr.filter(function(e) {
  18. return e.textContent != "View All"//for mobile version.
  19. });
  20.  
  21. arr.reverse()
  22. parent.append(...arr)
  23. console.log("Applied.")
  24. } catch(e) {
  25. console.error(`An error occurred.\n${e.message || e})`)
  26. }
  27. }
  28. Apply()