您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make Facebook Reel: Video Controls
// ==UserScript== // @name Facebook Reel: Video Controls // @namespace UserScript // @match https://www.facebook.com/* // @version 0.2.1 // @license MIT // @author CY Fung // @description Make Facebook Reel: Video Controls // @run-at document-start // @grant none // @unwrap // ==/UserScript== (() => { const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { if (entry.contentRect.height > 0) { document.documentElement.style.setProperty('--frvc-reel-control-height', entry.contentRect.height + 'px'); } } }); let addCSS = () => { if (addCSS.done) return; addCSS.done = true; document.head.appendChild(document.createElement('style')).textContent = ` .frvc-div-might-empty:empty { display: none; } .frvc-cursor-passthrough { pointer-events: none; } .frvc-cursor-passthrough [role], .frvc-cursor-passthrough [tabindex] { pointer-events: initial; } ` } document.addEventListener('play', (evt) => { const target = (evt || 0).target; if (target instanceof HTMLVideoElement) { if (target.hasAttribute('controls')) return; if (location.href.indexOf('reel') < 0) return; const buttonLayer = target.closest('div[class][role="button"][tabindex], div[role="main"]'); if (!buttonLayer) return; target.setAttribute('controls', ''); addCSS(); setTimeout(() => { Object.assign(target.style, { 'position': 'relative', 'zIndex': 999, 'pointerEvents': 'all', 'height': 'calc(100% - var(--frvc-reel-control-height))' }); let arr = [...buttonLayer.querySelectorAll('.x10l6tqk.x13vifvy:not(.x1m3v4wt)')].filter(elm => !elm.contains(target)); const clickable = buttonLayer.querySelectorAll('a[role="link"][href]'); const clickableHolder = [...new Set([...clickable].map(e => { do { if (arr.includes(e.parentNode)) return e; } while ((e = e.parentNode) instanceof HTMLElement); return null; }))].filter(e => !!e); for (const s of arr) { Object.assign(s.style, { 'pointerEvents': 'none' }); s.classList.add('frvc-cursor-passthrough') } for (const s of clickable) { Object.assign(s.style, { 'pointerEvents': 'initial' }); } const videoElmBRect = target.getBoundingClientRect(); let p = null; for (const s of clickableHolder) { const clickableHolderBRect = s.getBoundingClientRect(); if (p === null && clickableHolderBRect.bottom === clickableHolderBRect.bottom && clickableHolderBRect.top > videoElmBRect.top && clickableHolderBRect.left === clickableHolderBRect.left && clickableHolderBRect.right === clickableHolderBRect.right) { p = s; } Object.assign(s.style, { 'pointerEvents': 'initial', 'height': 'auto', 'boxSizing': 'border-box', 'paddingTop': '16px' }); } if (p) { addCSS(); for (const s of p.querySelectorAll('div[class]:empty')) { s.classList.add('frvc-div-might-empty'); } resizeObserver.disconnect(); resizeObserver.observe(p); } }, 1) } }, true); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址