您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动隐藏所有网站的图片和视频画面,保留声音播放
// ==UserScript== // @name 隐藏所有网站的视频和图片但保留声音 // @namespace http://tampermonkey.net/ // @version 1.3 // @description 自动隐藏所有网站的图片和视频画面,保留声音播放 // @author ChatGPT // @match *://*/* // @exclude *://*.douyin.com/* // @exclude *://chat.openai.com/* // @exclude *://*.deepseek.com/* // @exclude *://aistudio.google.com/* // @exclude *://*.bilibili.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function hideMediaElements() { // 视频、图片、嵌入媒体 const elements = document.querySelectorAll('video, img, iframe, object, embed'); elements.forEach(el => { // 保留音频轨道 if (el.tagName.toLowerCase() === 'video') { el.muted = false; // 保证声音播放 } // 隐藏元素 el.style.visibility = 'hidden'; el.style.width = '0px'; el.style.height = '0px'; el.style.display = 'none'; // 可选:彻底移除画面占位 }); } // 初次运行 hideMediaElements(); // 观察页面变化,防止 AJAX 动态加载新图像/视频 const observer = new MutationObserver(() => { hideMediaElements(); }); observer.observe(document.body, { childList: true, subtree: true }); })();