// ==UserScript== // @name Auto Claim Twitch drop(CN only) // @version 0.1 // @description Auto clicking "Click to claim a drop" under the chat really // @author ebk21 // @match https://www.twitch.tv/* // @run-at document-end // @license GPLv2 // @namespace CN_only // @downloadURL none // ==/UserScript== function time() { const today = new Date(); const date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate(); const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); const dateTime = date+' '+time; return dateTime } function main() { let button = document.querySelector('button[aria-label="领取奖励"]'); if(button != null){ button.click(); console.log('Clicked at '+ time()); } } function mainfr() { setTimeout(main,1200); } const observer = new MutationObserver(mainfr); observer.observe(document.body, {childList: true, subtree: true});