bandcamp shortcuts

space to pause, up and down arrows for next/prev song

  1. // ==UserScript==
  2. // @name bandcamp shortcuts
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-03-02
  5. // @description space to pause, up and down arrows for next/prev song
  6. // @author yegor c.
  7. // @match http*://*.bandcamp.com/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license GPLv3
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. document.addEventListener('keydown', function(event) {
  16. if (event.code === 'Space') {
  17. event.preventDefault();
  18. const button = document.querySelector('.playbutton');
  19. if (button) {
  20. button.click();
  21. }
  22. }
  23. if (event.code === 'ArrowUp') {
  24. event.preventDefault();
  25. const button = document.querySelector('.prevbutton');
  26. if (button) {
  27. button.click();
  28. }
  29. }
  30. if (event.code === 'ArrowDown') {
  31. event.preventDefault();
  32. const button = document.querySelector('.nextbutton');
  33. if (button) {
  34. button.click();
  35. }
  36. }
  37. });
  38. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址