返回列表

google duckduckgo baidu

默认分类 2014/06/17 16:31

duckduckgo

// ==UserScript==
// @name        direct link
// @namespace   duckduckgo directive
// @include     https://duckduckgo.com/
// @version     1
// @grant       none
// ==/UserScript==
DDG.get_http_redirect = function (b) {
    return b.href
};
window.onload = function () {
    jQuery('.result__a') .attr('target', '_blank');
};

google

// ==UserScript==
// @name        direct link
// @namespace   google directive
// @include     https://www.google.com.hk/search*
// @version     1
// @grant       none
// ==/UserScript==

window.onload = function(){
    var list = document.getElementById('rso').getElementsByTagName('h3'),
        item;
    for (var i=list.length-1; i>-1; i--){
        item = list[i].getElementsByTagName('a')[0];
        item.onmousedown = new Function('');
        item.setAttribute('target', '_blank');
    }
}