Radio.net space for toggle play/pause

auto selects never expire when making a paste

目前为 2021-09-13 提交的版本。查看 最新版本

// ==UserScript==
// @name         Radio.net space for toggle play/pause
// @namespace    https://gf.qytechs.cn/en/users/12725-alistair1231
// @version      0.1
// @description  auto selects never expire when making a paste
// @author       Alistair1231
// @match        https://www.radio.net/s/*
// @icon         https://icons.duckduckgo.com/ip2/radio.net.ico
// @grant        none
// @license GPL-3.0
// ==/UserScript==

(function() {
    'use strict';

function togglePlayingState(e){
    if(e.keyCode==32){
        e.preventDefault();
        let playButton = document.querySelector(".player__button.player__button--stopped.icon-play-circle")
        let stopButton = document.querySelector(".player__button.player__button--playing.icon-play-circle")

        let currentlyPlaying= playButton.style["display"]=='none' // play button hidden

        if(currentlyPlaying){
            console.log("stop")
            stopButton.click()
        }
        else{
            console.log("start")
            playButton.click()
        }
    }
}

document.addEventListener('keydown', togglePlayingState, false);


})();

QingJ © 2025

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