您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Google搜索、Github、YouTube点击链接时,在新的标签页打开链接网站
// ==UserScript== // @name Google搜索、Github、YouTube点击链接打开新的标签页 // @namespace http://tampermonkey.net/ // @version 0.1 // @description Google搜索、Github、YouTube点击链接时,在新的标签页打开链接网站 // @author wxb // @include https://www.google.com/search?* // @include https://github.com/* // @include https://www.youtube.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // 是不是YouTube网站 let isYouTube = location.origin === 'https://www.youtube.com'; let arr = Array.from(document.getElementsByTagName("a")); arr.forEach(item=>{ item.setAttribute("target","_blank"); if(isYouTube){ item.onclick = (e)=>{ window.open(`${item.href}`); e.stopPropagation(); } } }) })();