您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Floating video toggle button that hides when using synth
// ==UserScript== // @name Songsterr Video Toggle // @namespace http://tampermonkey.net/ // @version 1.2 // @description Floating video toggle button that hides when using synth // @license MIT // @match https://www.songsterr.com/* // @grant GM_addStyle // ==/UserScript== (function() { 'use strict'; GM_addStyle(` #video-toggle-btn { position: fixed; top: 100px; right: 20px; z-index: 9999; width: 40px; height: 40px; border-radius: 50%; background-color: rgba(80, 80, 80, 0.8); color: white; font-size: 20px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.3); transition: background 0.2s; } #video-toggle-btn:hover { background-color: rgba(100, 100, 100, 0.9); } `); let minimized = false; function addButton() { if (document.querySelector('#video-toggle-btn')) return; const btn = document.createElement('button'); btn.id = 'video-toggle-btn'; btn.innerHTML = '⬆'; document.body.appendChild(btn); btn.addEventListener('click', () => { const container = document.querySelector('#youtube-container'); if (!container) return; minimized = !minimized; container.style.display = minimized ? 'none' : 'block'; btn.innerHTML = minimized ? '⬇' : '⬆'; }); } function updateButtonVisibility() { const btn = document.querySelector('#video-toggle-btn'); const sourceRadio = document.querySelector('#control-source input[value="original"]'); if (!btn || !sourceRadio) return; btn.style.display = sourceRadio.checked ? 'flex' : 'none'; } // Initial button addButton(); updateButtonVisibility(); // Observe changes to button & radio inputs const observer = new MutationObserver(() => { addButton(); updateButtonVisibility(); }); observer.observe(document.body, { childList: true, subtree: true }); // Also watch for clicks on the radio buttons document.addEventListener('change', e => { if (e.target.matches('#control-source input')) { updateButtonVisibility(); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址