MyAnimeList Auto-Confirm updated entry

Automatically goes back to anime page after successfully updating an entry

目前為 2020-08-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         MyAnimeList Auto-Confirm updated entry
// @namespace    https://greasyfork.org/en/users/96096-purple-pinapples
// @version      0.2.2
// @description  Automatically goes back to anime page after successfully updating an entry
// @author       PurplePinapples
// @license      WTFPL
// @run-at       document-end
// @match        https://myanimelist.net/editlist.php?type=anime&id=*
// @match        https://myanimelist.net/panel.php?go=add&selected_series_id=*
// @match        https://myanimelist.net/panel.php?go=editmanga&id=*
// @match        https://myanimelist.net/ownlist/anime/*/edit
// @match        https://myanimelist.net/ownlist/manga/*/edit
// @match        https://myanimelist.net/ownlist/anime/*/delete
// @match        https://myanimelist.net/ownlist/manga/*/delete
// @match        https://myanimelist.net/panel.php?go=addmanga&selected_manga_id=*
// @match        https://myanimelist.net/ownlist/anime/add?selected_series_id=*
// @match        https://myanimelist.net/ownlist/manga/add?selected_manga_id=*
// @match        https://myanimelist.net/dbchanges.php?aid=*
// @match        https://myanimelist.net/dbchanges.php?mid=*
// @match        https://myanimelist.net/myfriends.php?go=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if ($("#content > .goodresult > strong:contains('Successfully')").length > 0) {
        location.href = $("#content > .goodresult > a:last-child").attr("href");
    }
    // structure for DB pages is slightly different
    if (location.href.indexOf("dbchanges") !== -1 && $(".goodresult:contains('Successfully')").length > 0) {
        location.href = $(".goodresult:contains('Successfully') > a:last-child").attr("href");
    }
  
    // structure for friend add page is slightly different as well  
    // includes a couple of differnet pages, adding/removing friends, approving/denying requests
    if (location.href.indexOf('myfriends.php') !== -1) {
      // do this more manually, since the 'successfully' text can be upper/lowercase
      const result = $(".goodresult")
      if (result.length > 0) {
        if (result.text().toLowerCase().indexOf("successfully") !== -1) {
          location.href = result.find("a[href*='profile']").attr('href');
        }
      }
    }
})();