您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replace zoomable vid with clone and close modal on click
当前为
// ==UserScript== // @name Mastodon vid // @description Replace zoomable vid with clone and close modal on click // @match https://mastodon.social/* // @run-at document-idle // @version 0.0.1.20250524075804 // @namespace https://greasyfork.org/users/1435046 // ==/UserScript== const observer = new MutationObserver(() => { const oldElement = document.querySelector('.gifv video'); if (oldElement && !oldElement.dataset.replaced) { const newElement = oldElement.cloneNode(true); // deep clone newElement.dataset.replaced = 'true'; // mark the new one oldElement.parentNode.replaceChild(newElement, oldElement); } }); observer.observe(document.body, { childList: true, subtree: true }); document.querySelector('.gifv video') .addEventListener('click', () => { document.querySelector('.media-modal__buttons .icon-button[title="Close"]').click(); });