kongyunzi

梦想成为化学家的程序员
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

修改IE8搜索框为指定搜索引擎,如CSDN、百度知道等

Posted on 2014-03-06 18:07  kongyunzi  阅读(376)  评论(0编辑  收藏  举报

1.运行regedit打开注册表编辑器
2.找到\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\
3.添加新搜索项,如NewSearch
4.在NewSearch中新建字符串项"DisplayName",并赋值为新搜索引擎的名称,该名称将显示在IE8搜索框内
5.在NewSearch中新建字符串项"URL"并赋值搜索引擎URL,如"http://so.csdn.net/search?t=thread&q={searchTerms}"
6.修改SearchScopes中DefaultScope值为"NewSearch",确定默认搜索引擎,该值亦可通过IE8的"管理搜索引擎"功能来设置
7.重启IE8后可直接利用搜索框进行指定搜索。

下面给出常见搜索引擎的URL:
博客园  http://zzk.cnblogs.com/s?t=b&w={searchTerms}
CSDN    http://so.csdn.net/search?t=thread&q={searchTerms}
百度知道   http://zhidao.baidu.com/search?word={searchTerms}&pn=0&ie=utf8&rn=10&lm=0&fr=search

搜索文本中含有中文时,同样可以获得正确的搜索结果,但有些搜索页面搜索框中显示乱码。
这是因为由IE搜索框传入的文本为UTF-8编码,而该页面搜索框是以ANSI进行解码显示的,不影响搜索使用。

可将下面的脚本语句保存为.reg文件执行

Windows Registry Editor Version 5.00

reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\cnblogs"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\cnblogs]
"DisplayName"="博客园"
"URL"="http://zzk.cnblogs.com/s?t=b&w={searchTerms}"

reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\CSDN"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\CSDN]
"DisplayName"="CSDN"
"URL"="http://so.csdn.net/search?t=thread&q={searchTerms}"

reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\zhidao"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\zhidao]
"DisplayName"="百度知道"
"URL"="http://zhidao.baidu.com/search?word={searchTerms}&pn=0&ie=utf8&rn=10&lm=0&fr=search"