Last active
November 19, 2024 08:02
-
-
Save lemonadeforlife/95cdde5ba4333ec26fbc6fe1f206928c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Animepahe Autoplay | |
// @namespace https://greasyfork.org/en/scripts/518033-animepahe-autoplay/ | |
// @version 2.1 | |
// @description Autoplay videos for you in 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 | |
// @downloadURL https://update.greasyfork.org/scripts/518033/animepahe%20autoplay.user.js | |
// @updateURL https://update.greasyfork.org/scripts/518033/animepahe%20autoplay.user.js | |
// @license Unlicense | |
// ==/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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment