您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
停用重播、解除靜音、可點擊進度條
当前为
// ==UserScript== // @name FB 停用重播、解除靜音、可點擊進度條 // @namespace http://tampermonkey.net/ // @version 2025-06-08 // @description 停用重播、解除靜音、可點擊進度條 // @author shanlan(ChatGPT o3-mini) // @match *://www.facebook.com/* // @grant none // @run-at document-end // @license MIT // ==/UserScript== (function() { 'use strict'; const addOverlay = video => { if(video._ov) return; const ov = document.createElement('div'); ov.style.cssText = "position:fixed; background:transparent; z-index:1000000; pointer-events:auto;"; document.body.appendChild(ov); video._ov = ov; const prog = document.createElement('div'); prog.style.cssText = "height:100%; width:0%; background:#f00;"; ov.appendChild(prog); // 利用 requestAnimationFrame 持續更新覆蓋層位置 const update = () => { const r = video.getBoundingClientRect(); ov.style.left = r.left + "px"; ov.style.top = (r.bottom - 8) + "px"; ov.style.width = r.width + "px"; ov.style.height = "8px"; requestAnimationFrame(update); }; requestAnimationFrame(update); // 進度條更新 video.addEventListener('timeupdate', ()=> { if(video.duration) prog.style.width = (video.currentTime/video.duration*100) + '%'; }); // 點擊事件:根據點擊位置調整播放進度 ov.addEventListener('pointerdown', e => { e.preventDefault(); e.stopPropagation(); const r = ov.getBoundingClientRect(); const pct = (e.clientX - r.left) / r.width; if(video.duration) video.currentTime = video.duration * pct; }, true); }; const enhance = video => { if(video._enhanced) return; video._enhanced = 1; video.loop = false; video.addEventListener('ended', ()=> { video.pause(); video.currentTime = video.duration; }); video.addEventListener('canplay', function unmute(){ video.muted = false; video.volume = 1; video.removeEventListener('canplay', unmute); }); addOverlay(video); }; const scan = node => { if(!node) return; if(node.nodeName === 'VIDEO') enhance(node); else node.querySelectorAll?.('video').forEach(enhance); }; new MutationObserver(muts => { muts.forEach(m => m.addedNodes.forEach(scan)); }).observe(document.body, {childList:true, subtree:true}); document.querySelectorAll('video').forEach(enhance); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址