您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto clicks the PLAY ON DEVICE button so you don't have to do it manually when you are opening multiple tabs on Last.fm
// ==UserScript== // @name Last.fm Auto Click PLAY ON DEVICE // @namespace http://tampermonkey.net/ // @version 1 // @description Auto clicks the PLAY ON DEVICE button so you don't have to do it manually when you are opening multiple tabs on Last.fm // @author dogAteTaco // @match *://last.fm/* // @match *://*.last.fm/* // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to attempt clicking the Play button inside the modal function clickPlayButton() { const playButton = Array.from(document.querySelectorAll('.form-group .btn-primary')) .find(button => button.textContent.trim() === 'Play on this device'); // Match by text content if (playButton && playButton.offsetParent !== null) { // Check if the button is visible playButton.click(); console.log("Play button clicked."); } else { console.log("Play button not found or not visible."); } } // Set up a MutationObserver to watch for DOM changes const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { // Check if the modal content has been added or changed if (mutation.type === 'childList' || mutation.type === 'subtree') { // Try to click the play button if it's visible clickPlayButton(); } }); }); // Start observing changes in the body and all subtrees (inside the page) observer.observe(document.body, { childList: true, // Observe direct child additions/removals subtree: true // Observe all descendants of the body }); // Optionally, you can try clicking the button immediately when the script loads clickPlayButton(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址