把google搜索结果的缓存链接变成https的gs脚本
2010-05-18 15:46
591 查看
借用了Google click-tracking disabler的代码,对原作者表示感谢。
// ==UserScript== // @name ghttpswebcache // @namespace wanderxjtu@twitter // @description 把google搜索结果的缓存链接变成https // @include http://www.google.com/search* // @include http://www.google.com.hk/search* // ==/UserScript== // A test for whether or not an object is a DOM node that can contain other DOM nodes var domlist = document.body.childNodes.constructor; function fertile(o) { return (o.childNodes || false) && (o.constructor == domlist); } // A simple string test we'll be using if (String.prototype.beginsWith) { console.warn('googleclicktrackingdisab.user.js warning: String.prototype.beginsWith() has already been defined'); } else { String.prototype.beginsWith = function(s) {return this.slice(0, s.length) == s; } } Array.prototype.forEach.call(document.getElementsByTagName('a'), function(el) { var s = el.getAttribute('href'); if (('string' == typeof s) && (s.beginsWith('http://webcache.google'))) el.setAttribute('href','https:'+s.slice(5,s.length)); });
相关文章推荐
- 在Google搜索结果显示原始链接
- 编写Python脚本来获取Google搜索结果的示例
- 在Google搜索结果显示原始链接
- 去掉Google搜索结果链接重定向的插件
- google不能打开,或者搜索结果链接不能访问的解决办法
- Google https搜索结果跳转时自动加https的方法
- 当GOOGLE搜索结果的链接无法打开时
- Google搜索结果出现快速直达链接
- 编写Python脚本来获取Google搜索结果的示例
- ubuntu下firefox打开google搜索结果链接,无法访问
- 在Google搜索结果显示原始链接
- 在Google搜索结果显示原始链接(转自 月光博客)
- 去掉Google搜索结果链接重定向的插件
- Google悄悄推行“链接 + 数据" 富内容摘要的搜索结果
- Google搜索结果链接重定向的插件
- 编写Python脚本来获取Google搜索结果的示例
- Google 小技巧:移除 Google 搜索结果页面的重定向脚本
- 解决Chrome中打不开Google搜索结果链接
- Bash脚本:在所有源文件中搜索特定模式,找到则打印结果后退出
- Google 根据用户地理位置和搜索历史定制搜索结果