让Firefox使用Google网页快照

由于众所周知的原因
在中国大陆不能直接使用Google提供的网页快照服务
刚才在水木NS版看了一些讨论解决了这个问题

发信人: mihiro (Lovely_mihiro), 信区: NewSoftware
标 题: Re: 为啥我的GOOGLE搜索,点击“网页快照”以后显示找不到服务
发信站: 水木社区 (Fri Feb 2 09:59:46 2007), 站内

ip改为72.14.203.104

/search?q=cache: 改为/search?&q=cache:

就可以看了

需要做的就是让脚本来替我们自动完成这些操作

首先安装Firefox扩展:Greasemonkey
这是一个可以通过执行JS脚本来自定义客户端显示的插件
安装完插件重启FF,文件–打开文件,选择脚本安装即可

下载脚本:googlecache.user.js

脚本是网上找的,源代码如下:

  1. // --------------------------------------------------------------------
  2. //
  3. // This is a Greasemonkey user script.
  4. //
  5. // To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
  6. // Then restart Firefox and revisit this script.
  7. // Under Tools, there will be a new menu item to "Install User Script".
  8. // Accept the default configuration and install.
  9. //
  10. // To uninstall, go to Tools/Manage User Scripts,
  11. // select "googlecache", and click Uninstall.
  12. //
  13. // --------------------------------------------------------------------
  14. //
  15. // WHAT IT DOES:
  16. // turn highlighted search terms into links to the next instance.
  17. // --------------------------------------------------------------------
  18. //
  19. // ==UserScript==
  20. // @name            Google Cached Pages
  21. // @description     Use different URLs to visit Google cached pages over China's Great Fire Wall (GFW)
  22. // @include         http://*.google.*/search*
  23. // ==/UserScript==
  24.    
  25. (function() {
  26.  var allLinks = document.links;
  27.  if (allLinks  != null)
  28.    {
  29.       for (i = 0; i <allLinks.length; ++i)
  30.       {
  31.          if (allLinks [i].href.indexOf ("/search?q=cache:") > 0)
  32.          {
  33.              allLinks [i].href = allLinks [i].href.replace ("/search?q=cache:", "/search?&q=cache:");
  34.              allLinks [i].href = allLinks [i].href.replace ("72.14.235.104", "72.14.203.104");
  35.          }
  36.       }
  37.    }
  38. }
  39. )();

Greasemonkey貌似是个很强大的插件
嘿嘿以后可以弄些好玩的

17fav 收藏本文
标签:, , , ,

相关日志 随机文章

Comments

Leave a Reply




请输入验证码

Use "<coolcode></coolcode>" to publish your code.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

京ICP备05059555号

收藏 & 分享

Powered by 17fav.com