Add new entries to PTW

Any new entries that you add to your list will added to your Plan To Watch list.

目前为 2021-05-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         Add new entries to PTW
// @namespace    ChangeAddBehavior
// @version      0.1
// @description  Any new entries that you add to your list will added to your Plan To Watch list.
// @author       hacker09
// @include      /^https:\/\/myanimelist\.net\/(anime|manga)\/[\d]+(\/.*)?/
// @icon         https://www.google.com/s2/favicons?domain=myanimelist.net
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  if (document.querySelector("#myinfo_status.btn-user-status-add-list.js-form-user-status.js-form-user-status-btn.myinfo_addtolist") !== null) { //If the anime is not on the user list
    document.querySelector("#myinfo_status.btn-user-status-add-list.js-form-user-status.js-form-user-status-btn.myinfo_addtolist").href = 'javascript:void(0);'
    document.querySelector("#myinfo_status.btn-user-status-add-list.js-form-user-status.js-form-user-status-btn.myinfo_addtolist").dataset.value = 6; //Add it as PTW

    document.querySelector("#myinfo_status.btn-user-status-add-list.js-form-user-status.js-form-user-status-btn.myinfo_addtolist").onclick = function() //When the Add button is clicked
    { //Starts the onclick function
      setTimeout(function() { //Wait the entry be added to the user list
        document.querySelector("#myinfo_status").value = '6'; //Set the anime as plan to watch, in a way that the user can see
        document.querySelector("#myinfo_status").dataset.class = 'plantowatch'; //Change the selection box to grey
      }, 700); //Finishes the settimout function
    } //Finishes the onclick function
  } //Finishes the if condition
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址