惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Security @ Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
Attack and Defense Labs
Attack and Defense Labs
Jina AI
Jina AI
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
H
Help Net Security
V
Visual Studio Blog
宝玉的分享
宝玉的分享
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
Latest news
Latest news
T
Tor Project blog
I
Intezer
美团技术团队
GbyAI
GbyAI
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
Y
Y Combinator Blog
博客园 - 司徒正美
T
Tenable Blog
O
OpenAI News
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threatpost
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
Help Net Security
Help Net Security

博客园 - 张远强

原版SQLHelper.cs下载 Chrome浏览器Proxy Switchy、Tampermonkey等扩展程序下载 站在31岁,理解程序员年过三十这道坎 GreaseMonkey让网站登录验证码形同虚设 DateTime.ToString格式限定符转义 借Windows说明Linux分区和挂载点 JSON解析类(C#) 彻底解决ASP.NET MD5加密中文结果和ASP不一致的问题 SharpZipLib使用示例 DotNetZip使用示例 Dvbbs 8.2.0 RC1多功能编辑器,提供下载 B/S系统版本管理V1.0正式发布 ASP.NET 2.0缓存 个人网站与动网整合步骤(支持PDO1.0) - 张远强 - 博客园 C#中显/隐式实现接口及其访问方法 C#接口范例 巧用escape解决ASP.NET中URL传参乱码问题 使用Filter实现信息的二次检索 使用overflow代替left截取指定长度字符串
GreaseMonkey脚本:阻止Google转换搜索链接地址
张远强 · 2012-05-06 · via 博客园 - 张远强

现在访问Google越来越不稳定,往往是刚刚还可以搜索,搜索链接却打不开。观察后发现Google对搜索链接地址有做了转换,总要做如下类似跳转:

1 http://www.google.com.hk/url?sa=t&rct=j&q=%E6%9C%A8%E5%AD%90%E5%B1%8B&source=web&cd=1&ved=0CGUQFjAA&url=http%3A%2F%2Fwww.mzwu.com%2F&ei=l7ilT_jBB8uSiQf99IGmAw&usg=AFQjCNFctvtehTHWHzB5A2MzvC7bM7qfpA&cad=rja

访问不了http://www.google.com.hk/,跳转自然也就不成功了。那能不能复制出链接原地址,再粘贴到地址栏打开?测试后发现复制的链接地址也是转换后的。

继续分析发现:Google对搜索链接地址的转换过程是在客户端进行的,准确的说是在鼠标按下时进行的:

鼠标按下前的链接:

1 <onmousedown="return rwt(this,'','','','1','AFQjCNFctvtehTHWHzB5A2MzvC7bM7qfpA','','0CGUQFjAA',null,event)" class="l" target="_blank" href="http://www.mzwu.com/"><em>木子屋</em>-Dnawo's BLOG</a>

鼠标按下后的链接:

1 <onmousedown="return rwt(this,'','','','1','AFQjCNFctvtehTHWHzB5A2MzvC7bM7qfpA','','0CGUQFjAA',null,event)" class="l" target="_blank" href="http://www.google.com.hk/url?sa=t&rct=j&q=%E6%9C%A8%E5%AD%90%E5%B1%8B&source=web&cd=1&ved=0CGUQFjAA&url=http%3A%2F%2Fwww.mzwu.com%2F&ei=l7ilT_jBB8uSiQf99IGmAw&usg=AFQjCNFctvtehTHWHzB5A2MzvC7bM7qfpA&cad=rja"><em>木子屋</em>-Dnawo's BLOG</a>

既然转换是在客户端进行,那我们就有办法阻止了,只需要改写rwt函数即可,使用GreaseMonkey很容易就能实现。


GreaseMonkey脚本:

 1 // ==UserScript==
 2 // @name           StopRWT
 3 // @namespace      com.mzwu.www
 4 // @description    阻止Google转换搜索链接地址
 5 // @include        http://www.google.com.hk*
 6 // ==/UserScript==
 7 
 8 var gcounter = 0;
 9 var gtimer = window.setInterval(function(){
10         if(!!unsafeWindow.rwt){
11             unsafeWindow.rwt = function(){};
12             window.clearInterval(gtimer);
13             document.title = "阻止Google转换搜索链接地址成功!";
14         }
15         if(++gcounter==10){
16             window.clearInterval(gtimer);
17         }
18     },1000
19 );

Firefox12.0下测试通过!Chrome用户安装扩展Tampermonkey也可以使用上边脚本。


相关阅读