MyAnimeList Auto-Confirm updated entry

Automatically goes back to anime page after successfully updating an entry

  1. // ==UserScript==
  2. // @name MyAnimeList Auto-Confirm updated entry
  3. // @namespace https://greasyfork.org/en/users/96096-purple-pinapples
  4. // @version 0.2.2
  5. // @description Automatically goes back to anime page after successfully updating an entry
  6. // @author PurplePinapples
  7. // @license WTFPL
  8. // @run-at document-end
  9. // @match https://myanimelist.net/editlist.php?type=anime&id=*
  10. // @match https://myanimelist.net/panel.php?go=add&selected_series_id=*
  11. // @match https://myanimelist.net/panel.php?go=editmanga&id=*
  12. // @match https://myanimelist.net/ownlist/anime/*/edit
  13. // @match https://myanimelist.net/ownlist/manga/*/edit
  14. // @match https://myanimelist.net/ownlist/anime/*/delete
  15. // @match https://myanimelist.net/ownlist/manga/*/delete
  16. // @match https://myanimelist.net/panel.php?go=addmanga&selected_manga_id=*
  17. // @match https://myanimelist.net/ownlist/anime/add?selected_series_id=*
  18. // @match https://myanimelist.net/ownlist/manga/add?selected_manga_id=*
  19. // @match https://myanimelist.net/dbchanges.php?aid=*
  20. // @match https://myanimelist.net/dbchanges.php?mid=*
  21. // @match https://myanimelist.net/myfriends.php?go=*
  22. // @grant none
  23. // ==/UserScript==
  24.  
  25. (function () {
  26. "use strict";
  27. if (
  28. $("#content > .goodresult > strong:contains('Successfully')").length > 0
  29. ) {
  30. location.href = $("#content > .goodresult > a:last-child").attr("href");
  31. }
  32. // structure for DB pages is slightly different
  33. if (
  34. location.href.indexOf("dbchanges") !== -1 &&
  35. $(".goodresult:contains('Successfully')").length > 0
  36. ) {
  37. location.href = $(
  38. ".goodresult:contains('Successfully') > a:last-child"
  39. ).attr("href");
  40. }
  41.  
  42. // structure for friend add page is slightly different as well
  43. // includes a couple of differnet pages, adding/removing friends, approving/denying requests
  44. if (location.href.indexOf("myfriends.php") !== -1) {
  45. // do this more manually, since the 'successfully' text can be upper/lowercase
  46. const result = $(".goodresult");
  47. if (result.length > 0) {
  48. if (result.text().toLowerCase().indexOf("successfully") !== -1) {
  49. location.href = result.find("a[href*='profile']").attr("href");
  50. }
  51. }
  52. }
  53. })();