您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
谷歌百度搜狗必应头条DuckDuckGo、Ecosia 搜索结果新标签打开
当前为
// ==UserScript== // @name 搜索引擎新标签打开链接 // @description 谷歌百度搜狗必应头条DuckDuckGo、Ecosia 搜索结果新标签打开 // @version 1.0 // @author ChatGPT // @match *://so.toutiao.com/* // @match *://www.ecosia.org/* // @match *://fsoufsou.com/* // @match *://duckduckgo.com/* // @match *://www.google.co.jp/* // @match *://www.google.com.hk/* // @match *://www.google.com/* // @match *://m.baidu.com/* // @match *://www.baidu.com/* // @match *://wap.sogou.com/* // @match *://m.sogou.com/* // @match *://www.sogou.com/* // @match *://cn.bing.com/* // @match *://www.bing.com/* // @run-at document-idle // @grant none // @namespace http://greasyfork.icu/users/452911 // ==/UserScript== (function() { 'use strict'; if (window.location.href.indexOf("search") != -1 || window.location.href.indexOf("q=") != -1 || window.location.href.indexOf("wd=") != -1 || window.location.href.indexOf("word=") != -1) { // 网页 URL 包含 "search"、"q="、"wd=" 或 "word=",执行以下操作 function modifyLinks() { let links = document.getElementsByTagName('a'); for (let i = 0; i < links.length; i++) { links[i].setAttribute('target', '_blank'); } let base = document.getElementsByTagName('base')[0]; if (base) { base.setAttribute('target', '_blank'); } else { let head = document.getElementsByTagName('head')[0]; let newBase = document.createElement('base'); newBase.setAttribute('target', '_blank'); head.appendChild(newBase); } } modifyLinks(); document.addEventListener('touchend', modifyLinks); } })();