读书人

把Google的搜寻果链接里面的地址设为

发布时间: 2012-11-15 15:16:14 作者: rapoo

把Google的搜索果链接里面的地址设为直接的原始地址

javascript:function view(node){ for(var i=0;i<node.childNodes.length;i++){ var cn = node.childNodes[i]; if(cn.childNodes.length>0) view(cn); if(cn.nodeName=='A'){ var href = cn.href; var pref = 'http://www.google.com.hk'; var index = pref.length; if(href.indexOf(pref)==0){ href = 'https://www.google.com.hk'+href.substr(index); } cn.onmousedown = null; } } } (function(){ var ol = document.getElementById('rso'); view(ol); })();

这是第二版更新, Google搜索结果格式有细微的差别, 硬编码兼容性非常差, 现在改为自动检索每一个链接, 如果用http://google.com.hk开头的, 自动替换为https://google.com.hk, 加密传输速度也很快. 不存在打不开的情况.

读书人网 >互联网

热点推荐