// ==UserScript== // @name animepahe autoplay // @namespace https://gist.github.com/lemonadeforlife/95cdde5ba4333ec26fbc6fe1f206928c // @version 2.0 // @description Autoplay feature for Animepahe // @author lemonade_for_life // @match https://animepahe.ru/play/* // @include https://kwik.si/* // @icon https://www.google.com/s2/favicons?sz=64&domain=animepahe.ru // @grant none // @license Unlicense // @downloadURL none // ==/UserScript== target = document.querySelector('.click-to-load'); video_player = document.querySelector("#kwikPlayer"); function check(changes, observer) { if(target!=null) { target.click(); } else if (video_player!=null && document.querySelector('.plyr__poster')!=null){ observer.disconnect(); video_player.play(); video.player.focus(); } } const observer = new MutationObserver(check); const config = {childList: true, subtree: true}; observer.observe(document, config)