您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自動移除 YouTube Premium 推銷彈窗與背景遮罩
// ==UserScript== // @name 移除 YouTube Premium 彈跳視窗與遮罩 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 自動移除 YouTube Premium 推銷彈窗與背景遮罩 // @match *://*.youtube.com/* // @author issac // @license GPL-3.0 License // @grant none // ==/UserScript== (function() { 'use strict'; function removePopupsAndBackdrop() { // 移除 Premium 彈窗 document.querySelectorAll('.yt-spec-dialog-layout__dialog-layout-container').forEach(popup => { popup.remove(); console.log('✅ 已移除 Premium 彈窗'); }); // 移除背景遮罩 document.querySelectorAll('tp-yt-iron-overlay-backdrop.opened').forEach(backdrop => { backdrop.remove(); console.log('✅ 已移除背景遮罩'); }); } // 頁面初始移除一次 removePopupsAndBackdrop(); // 監聽 DOM 變化,持續移除 const observer = new MutationObserver(removePopupsAndBackdrop); observer.observe(document.body, { childList: true, subtree: true }); })();