// ==UserScript== // @name Add new entries to your MyAnimeList - Chiaki // @namespace https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs // @version 7 // @description With a single click add all entries from an entire franchise on any chiaki.site page directly to your MAL account with the status of your choice. // @author hacker09 // @match https://chiaki.site/?/auth // @match https://chiaki.site/?/tools/watch_order/* // @match https://myanimelist.net/dialog/authorization // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://chiaki.site/&size=64 // @run-at document-end // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; if (location.href.match('chiaki') !== null && document.querySelector('a.uk-button.uk-button-text.uk-text-danger').innerText === 'SIGN IN' && location.href !== 'https://chiaki.site/?/') //If the user is on the chiaki.site and it the user isn't signed in on chiaki.site, and if the user wasn't returned to the chiaki.site home page { //Starts the if condition document.querySelector('a.uk-button.uk-button-text.uk-text-danger').click(); //Click on the sign in btn if (location.href.match('auth') !== null) //If the user is on the auth chiaki.site page { //Starts the if condition document.querySelectorAll('.uk-button-large')[1].click(); //Click on the SIGN IN WITH MYANIMELIST btn } //Finishes the if condition } //Finishes the if condition if (location.href.match('authorization') !== null) //If the user is on the MAL auth website { //Starts the if condition window.onload = function() { //When the page finishes loading setTimeout(function() { if (document.querySelectorAll("form > input")[1].id !== 'clicked') //If the form id is not clicked { //Starts the if condition document.querySelectorAll("form > input")[1].click(); //Click on the Allow btn } //Finishes the if condition }, 300); //Click on the Allow btn }; //Finishes the onload event listener } //Finishes the if condition if (location.href === 'https://chiaki.site/?/') //When the user gets returned to the chiaki.site home page { //Starts the if condition window.history.go(-3); //Return to the franchise page } //Finishes the if condition document.querySelector("ul.uk-flex-center.noborder.uk-tab").insertAdjacentHTML('beforeend', '