您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在VIA浏览器中点击任何链接后在新标签页打开,原标签页不响应,并切换到新标签页,取消静音
当前为
// ==UserScript== // @name Open Links in New Tab // @namespace http://tampermonkey.net/ // @version 1.1.4 // @description 在VIA浏览器中点击任何链接后在新标签页打开,原标签页不响应,并切换到新标签页,取消静音 // @author ZZGGCC // @match *://*.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to open links in a new tab, switch to it, and prevent original tab response function openLinksInNewTab(event) { // Ensure the clicked element is a link const link = event.target.closest('a'); if (link && link.href) { event.preventDefault(); // Prevent the default link behavior const newTab = window.open(link.href, '_blank'); // Open the link in a new tab if (newTab) { newTab.focus(); // Switch to the new tab // Adding an interval to continuously check for video elements const checkVideoInterval = setInterval(() => { const videoElements = newTab.document.querySelectorAll('video, audio'); if (videoElements.length > 0) { videoElements.forEach(video => { video.muted = false; // Unmute the video video.volume = 1.0; // Set volume to maximum }); clearInterval(checkVideoInterval); // Clear the interval once video is found and unmuted } }, 1000); // Check every second } event.stopPropagation(); // Stop the event from propagating further } } // Add event listener to the document to capture all click events document.addEventListener('click', openLinksInNewTab, true); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址