代码改变世界

让你的Firefox使用Google.CN进行搜索

2006-06-02 22:03  Colin Han  阅读(1583)  评论(1编辑  收藏  举报
使用Firefox,默认的使用Google.com作为搜索引擎。但是最近一段时间,使用Google.com搜索常有失败。只好退而求其次,使用被阉割的Google.CN
但是,不能使用工具栏上的搜索,总是很不方便。使用Firefox的添加搜索引擎页面上也没有Google.cn。只好自己研究解决。下面是解决办法:

首先找到Firefox的安装路径,一般情况下为:C:\Program Files\Mozilla Firefox。其中包含子目录:searchplugins。其中包含文件google.src。
新建一个新的文件,命名为:google-cn.src,同时,复制google.gif为google-cn.gif。打开google-cn.src编辑。内容如下:

--------------------------------------------------------------------------------------------
# Mozilla/Google plug-in by amitp+mozilla@google.com

<search
   name="Google.CN"
   description="Google.CN Search"
   method="GET"
   action="http://www.google.cn/search"
   queryCharset="utf-8"
>

<input name="q" user>
<inputnext name="start" factor="10">
<inputprev>
<input name="ie" value="utf-8">
<input name="oe" value="utf-8">

<interpret
    browserResultType="result"
    charset = "UTF-8"
    resultListStart="<!--a-->"
    resultListEnd="<!--z-->"
    resultItemStart="<!--m-->"
    resultItemEnd="<!--n-->"
>
</search>

<browser
    update="https://addons.mozilla.org/searchplugins/updates/googlecn.src"
    updateIcon="https://addons.mozilla.org/searchplugins/updates/googlecn.gif"
    updateCheckDays="1"
>

--------------------------------------------------------------------------------------------

修改部分,我用粗体标注了。保存后,重新打开Firefox。在Firefox的搜索引擎列表中会多出一个Google.CN。以后就可以使用Google.CN进行搜索了。