// ==UserScript== // @name zoro autofocus // @namespace https://greasyfork.org/en/users/10118-drhouse // @version 5.31 // @description Auto focuses on the video player when you open an anime and when it auto nexts to new episode (you can use keyboard shortcuts without clicking on the video player). // @include https://zoro.to/* // @include https://rapid-cloud.co/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @require https://greasyfork.org/scripts/439099-monkeyconfig-modern-reloaded/code/MonkeyConfig%20Modern%20Reloaded.js?version=1012538 // @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js // @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_addStyle // @grant GM_registerMenuCommand // @grant GM_notification // @author agent-324 // @license CC-BY-NC-SA-4.0 // @icon https://www.google.com/s2/favicons?domain=zoro.to // @downloadURL none // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); (function($){ var cfg = new MonkeyConfig({ title: 'Configure', menuCommand: false, params: { 'Automatic Highest Quality': { type: 'checkbox', default: true } } }) if (cfg.get('Automatic Highest Quality')) { const myInterval = setInterval(myTimer, 1000); function myTimer() { var $highest_check = $('#jw-settings-submenu-quality > div:nth-child(1) > button:nth-child(2)').attr('aria-checked') var $auto_check = $('#jw-settings-submenu-quality > div:nth-child(1) > button:nth-child(1)').text() $('div.jw-icon:nth-child(14)')[0].click() if ($auto_check === 'Auto'){ if ($highest_check === "true"){ $('div.jw-icon:nth-child(14)')[0].click() clearInterval(myInterval); } else { $('#jw-settings-submenu-quality > div:nth-child(1) > button:nth-child(2)').click() } } else { $('div.jw-icon:nth-child(14)')[0].click() clearInterval(myInterval); } } } })(jQuery);