您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Use spacebar on Bandcamp to control music playback
当前为
// ==UserScript== // @name Play / Pause with spacebar on Bandcamp // @namespace https://openuserjs.org/users/burn // @version 0.1.1 // @description Use spacebar on Bandcamp to control music playback // @author burn // @copyright 2020, burn (https://openuserjs.org//users/burn) // @license MIT // @match https://*.bandcamp.com/album/* // @match https://*.bandcamp.com/track/* // @include https://*.bandcamp.com/album/* // @include https://*.bandcamp.com/track/* // @grant none // @run-at document-end // ==/UserScript== // ==OpenUserJS== // @author burn // ==/OpenUserJS== (function() { 'use strict'; const DBG = false; let log = function(s) { DBG && console.log(s); }, elmTarget = "#trackInfoInner > div.inline_player > table > tbody > tr:nth-child(1) > td.play_cell > a > div", qS = function(el, scope) { scope = (typeof scope == 'object') ? scope : document; return scope.querySelector(el) || false; }, qSall = function(els, scope) { scope = (typeof scope == 'object') ? scope : document; return scope.querySelectorAll(els) || false; }; window.addEventListener('keydown', function(e) { log("in keydown: " + e.target); if(e.keyCode == 32 && e.target == document.body) { log("keydown ok"); e.preventDefault(); } }); qS('body').addEventListener("keyup", function(e) { log("in keyup: " + e.target); log(qS(elmTarget)); if (e.keyCode == 32 && e.target == document.body) { log("keyup ok"); e.preventDefault(); qS(elmTarget).click(); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址