一个很实用的功能被屏蔽了,以前在浏览器里面输入view-source:http://www.yici.net就可以在不打开执行该页面的情况下查看这个页面的源代码,这对分析一个网页是否带病毒很有用,没必要先打开,中毒一次再从"查看"--"源代码"里去看代码.但XP SP2以后的版本包括WIN2003已经没有这个功能.
在国内查过不少资料,没找到详细的,后来在一个国外站点上,看到了比较详细的解答.
--------------------------------------------------------------------------------
View Link Source for Internet Explorer makes it easier to VIEW the LINK SOURCE of a stream. When installed you can right-click on a link and then a View Link Source option is availabe in the context menu. It is also possible to select the text of the location (with or without http://)andright-clickontheselectiontoViewLinkSo ... himagesthathavealinktoafile.
Installation instructions:
Open notepad and copy the following text into it:
<script language="javascript" defer>
if (external.menuArguments) {
var selectedtext = external.menuArguments.document.selection.createRange().text;
if(selectedtext) {
if(selectedtext.match("http://"))window.open('view-source:'+selectedtext);
else window.open('view-source:http://'+selectedtext); }
else {
var clickelement = external.menuArguments.event.srcElement;
if ( clickelement.tagName == 'IMG' )
window.open('view-source:' + clickelement.parentElement.href);
else window.open('view-source:' + clickelement.href); }}
</script>
And save as viewsource.html in C:\WINDOWS\Web.
Clear notepad and copy into it:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\View Link Source]
@="C:\\windows\\web\\viewsource.html"
"contexts"=dword:00000032
Save as viewsource.reg in any folder. Double-click on viewsource.reg to add it to the registry. When Windows asks for a confirmation choose Yes.
When you want to remove the add-on, open viewsource.reg in notepad and change [HKEY to [-HKEY and save it. Double-click to remove the key from the registry. And delete viewsource.html in C:\WINDOWS\Web.
For more (technical) information about custom IE context menus go to www.siteexperts.com/tips/hj/ts01/index.asp
View Link Source Internet Explorer add-on is also available as a ZIP download in any of the files sections of Veblin Software.
--------------------------------------------------------------------------------
后来按他的方法试了下,还是不行,先把
<script language="javascript" defer>
if (external.menuArguments) {
var selectedtext = external.menuArguments.document.selection.createRange().text;
if(selectedtext) {
if(selectedtext.match("http://"))window.open('view-source:'+selectedtext);
else window.open('view-source:http://'+selectedtext); }
else {
var clickelement = external.menuArguments.event.srcElement;
if ( clickelement.tagName == 'IMG' )
window.open('view-source:' + clickelement.parentElement.href);
else window.open('view-source:' + clickelement.href); }}
</script>
保存为viewsource.html并复制到C:\WINDOWS\Web
再把REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\View Link Source]
@="C:\\windows\\web\\viewsource.html"
"contexts"=dword:00000032
保存为viewsource.reg双击导入注册表.重起没效果,一样不能用.
协议不支持,有人给出的建议是:用www.mozilla.org/products/firefox/做浏览器,这个浏览器支持这个协议,或者是用特殊的软件查看www.codelifter.com/.
至于微软屏蔽这个功能的原因,是因为这个存在一个漏洞,可以让view-source读取某些恶意代码