您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
SomaFM web player stops for some reason in any browser. Fix it in a dirty way.
// ==UserScript== // @name [SomaFM] Never stop playback! // @namespace none // @version 2024-05-06 // @description SomaFM web player stops for some reason in any browser. Fix it in a dirty way. // @author https://github.com/vasyan // @match https://somafm.com/player/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function debounce (func, timeout) { var timer; return function () { clearTimeout(timer); timer = setTimeout(function () { func.apply(this, arguments); }, timeout); } } var reloadPage = debounce(function () { console.log('reload') location.reload(); }, 2500); // console.log('listen timeupdate', document.querySelector('#audioPlayer audio'), document.querySelector('#audioPlayer audio').paused); document.querySelector('#audioPlayer audio').addEventListener('timeupdate', function() { // console.log('call debounced'); reloadPage(); }); console.info('SomaFM will never stop!'); })();