Find Missing Entries

Opens all pages on MAL that are not on your list.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Find Missing Entries
// @namespace    https://greasyfork.org/en/users/96096
// @version      1.0.4
// @description  Opens all pages on MAL that are not on your list.
// @author       PurplePinapples
// @license      WTFPL
// @match        https://myanimelist.net/*
// @run-at       document-end
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

function exit_script () {
    "use strict";
    GM_setValue("reloadPageFailed", 0);
    location.href = (location.href.replace("&autoOpenMissingEntries=true", ""));
}

(function() {
    "use strict";
    var RELOAD_IF_FAIL_MAX = 5;
    if (location.href.toString().indexOf("&autoOpenMissingEntries=true") === -1) {
        //place menu option
        $(".header-menu-dropdown.header-list-dropdown.arrow_box").find("li:contains('Manga List')").after("<li><a href=\"https://myanimelist.net/anime.php?o=9&c%5B0%5D=a&c%5B1%5D=d&cv=2&w=1&autoOpenMissingEntries=true\">Open Missing</a></li>");
    } else {
        //on the starting page, check for errors then open pages
        if ($("html").find("div.js-block-list").find("tr").length === 0) { //if page failed (i.e. no MAL entries loaded into table)
            GM_setValue("reloadPageFailed", GM_getValue("reloadPageFailed", 0) + 1);
            window.location.reload(); //reload the page
        } else {
            GM_setValue("reloadPageFailed", 0); //if page didnt fail, set it back to 0.
        }
        if (GM_getValue("reloadPageFailed", 0) >= RELOAD_IF_FAIL_MAX) { //if we've failed 5 times, stop
            window.alert("Failed too many times. Exiting Script");
            exit_script();
            return;
        }
        if ($(".btn-login").text().trim() === "Login") { //if user isnt logged in
            window.alert("You aren't logged in. Please login and try again.");
            exit_script();
            return;
        }
        //open pages not on your list
        $('tr a.Lightbox_AddEdit[href*="ownlist/anime/add"]').each(function() {
            const link = $(this).parent().find('a[href*="myanimelist.net/anime"')
            window.open($(link).attr("href"));
        });
        if (location.href.indexOf("&show") === -1) {
            location.href = location.href + "&show=50";
        } else {
            var parts = location.href.split("&show=");
            location.href = parts[0] + "&show=" + (+parts[1] + 50).toString();
        }
    }
})();