您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks the "Load More Episodes" button when scrolling down the page on Spotify
当前为
// ==UserScript== // @name Infinite Scroll Spotify Episodes // @namespace https://greatest.deepsurf.us/en/users/1200587-trilla-g // @version 1.0 // @description Automatically clicks the "Load More Episodes" button when scrolling down the page on Spotify // @author Trilla_G // @match *://*.open.spotify.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let isPaused = false; // Define the selector for the button with the exact class name const buttonSelector = '.vqQmhCMZq7eUtTV7YYOQ.epDbBe.LegacyChipInner__ChipInnerComponent-sc-1qguixk-0'; // Function to check for the button and click it function checkForButtonAndClick() { if (isPaused) return; const button = document.querySelector(buttonSelector); if (button) { button.click(); console.log('Button clicked!'); } } // Function to handle scroll events function onScroll() { if (!isPaused) { checkForButtonAndClick(); } } // Add scroll event listener window.addEventListener('scroll', onScroll); // Use a MutationObserver to detect when the button is added to the DOM const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (!isPaused && mutation.addedNodes.length > 0) { checkForButtonAndClick(); } }); }); // Start observing the body for added nodes observer.observe(document.body, { childList: true, subtree: true }); // Initial check in case the button is already present when the script runs checkForButtonAndClick(); // Add an event listener for the specific keystroke to pause the function document.addEventListener('keydown', (event) => { if (event.code === 'Delete') { isPaused = true; console.log('Paused for 15 seconds'); setTimeout(() => { isPaused = false; console.log('Resumed'); }, 15000); // 15000 milliseconds = 15 seconds } }); })();