您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Open all YouTube videos and Shorts in a new tab on the mobile website
// ==UserScript== // @name YouTube Mobile Open Videos and Shorts in New Tab // @namespace http://tampermonkey.net/ // @version 1.0 // @description Open all YouTube videos and Shorts in a new tab on the mobile website // @author Agreasyforkuser // @match *://m.youtube.com/* // @icon https://www.google.com/s2/favicons?domain=youtube.com // @grant none // ==/UserScript== (function() { 'use strict'; // Function to modify all video and Shorts links function updateLinks() { // Select all anchor tags for regular videos and Shorts const videoLinks = document.querySelectorAll('a[href*="/watch"], a[href*="/shorts/"]'); videoLinks.forEach(link => { link.setAttribute('target', '_blank'); // Ensure they open in a new tab }); } // Run the function initially updateLinks(); // Observe changes to the page for dynamic content loading const observer = new MutationObserver(() => { updateLinks(); // Update links whenever the page changes }); // Start observing the body for changes observer.observe(document.body, { childList: true, subtree: true }); })();