您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在手机浏览器中点击任何链接后在新标签页打开,原标签页不响应,并切换到新标签页,取消静音
// ==UserScript== // @name 🍀youtube新标签页打开🍀 // @namespace http://tampermonkey.net/ // @version 1.1.7 // @description 在手机浏览器中点击任何链接后在新标签页打开,原标签页不响应,并切换到新标签页,取消静音 // @author ZZGGCC // @match *://*.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function openLinksInNewTab(event) { const link = event.target.closest('a'); if (link && link.href) { event.preventDefault(); const newTab = window.open(link.href, '_blank'); if (newTab) { newTab.focus(); const checkVideoInterval = setInterval(() => { const videoElements = newTab.document.querySelectorAll('video, audio'); if (videoElements.length > 0) { videoElements.forEach(video => { video.muted = false; video.volume = 1.0; }); clearInterval(checkVideoInterval); } }, 1000); } event.stopPropagation(); } } function addEventListenerToDocument() { document.addEventListener('click', openLinksInNewTab, true); } addEventListenerToDocument(); const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'childList' || mutation.type === 'attributes') { addEventListenerToDocument(); } }); }); observer.observe(document, { childList: true, subtree: true, attributes: true }); })();