Tempermonkey脚本代码分享,谷歌搜索链接改成新窗口打开

时间:4年前   阅读:5068

Tempermonkey脚本代码分享,谷歌搜索链接改成新窗口打开,在使用搜索时大部分搜索引擎都是新窗口打开的然而谷歌搜索是在当前窗口打开的,这样用起来很不习惯,用下面的脚本可以解决:

// ==UserScript==
// @name         谷歌搜索链接改为新窗口打开
// @namespace    none
// @version      1
// @description  //谷歌搜索链接改为新窗口打开,www.qiquanji.com
// @author       XBX
// @include      https://www.google.*/search*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var links = document.getElementById('res').getElementsByTagName('a');
    var len = links.length;
    for(var i = 0; i < len; i++){
        links[i].setAttribute('target','_blank');
    }
    // Your code here...
})();

本站声明:网站内容来源于网络,如有侵权,请联系我们https://www.qiquanji.com,我们将及时处理。

微信扫码关注

更新实时通知

上一篇:potplayer设置最前端

下一篇:Tempermonkey脚本代码分享,Tempermonkey链接替换

网友评论

请先 登录 再评论,若不是会员请先 注册