您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks the "Load More Episodes" button when visible on Spotify
当前为
- // ==UserScript==
- // @name Infinite Scroll Spotify Episodes
- // @namespace https://greasyfork.org/en/users/1200587-trilla-g
- // @version 3.7
- // @description Automatically clicks the "Load More Episodes" button when visible on Spotify
- // @author Trilla_G
- // @match *://*.open.spotify.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- // Define the selector for the button with the new provided selector
- const buttonSelector = '.vqQmhCMZq7eUtTV7YYOQ.eJmJgo.LegacyChipInner__ChipInnerComponent-sc-1qguixk-0 > .encore-text-body-small-bold.encore-text';
- // Function to check if an element is in the viewport
- function isInViewport(element) {
- const rect = element.getBoundingClientRect();
- return (
- rect.top >= 0 &&
- rect.left >= 0 &&
- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
- rect.right <= (window.innerWidth || document.documentElement.clientWidth)
- );
- }
- // Function to check for the button and click it if it's in the viewport
- function checkForButtonAndClick() {
- const button = document.querySelector(buttonSelector);
- if (button && isInViewport(button)) {
- button.click();
- }
- }
- // Run checkForButtonAndClick every second
- setInterval(checkForButtonAndClick, 1000);
- // Initial check in case the button is already present when the script runs
- checkForButtonAndClick();
- })();