手动给IE右键菜单添加“复制图片链接”功能

第一步:将下面红色代码复制粘贴到记事本中,保存文件名为CopyImageUrl.html

<SCRIPT LANGUAGE="JavaScript" defer>
     var parentWin = external.menuArguments;
     var srcEvent = external.menuArguments.event;
     var doc = parentWin.document;
     var eventElement = doc.elementFromPoint ( srcEvent.clientX, srcEvent.clientY );
     var cpb = parentWin.clipboardData;
     var srcImage = eventElement;
     var str = new String(srcImage.href.toString());
     str =   str   
     cpb.setData("Text",str.toString());
</SCRIPT>

第二步:将下面代码复制粘贴到记事本中,保存文件名CopyImageUrl.inf
[Version]
Signature="$Chicago$"
Provider="MetaBuilders"
[DestinationDirs]
DefaultDestDir=10,"web"
[DefaultInstall]
AddReg=CopyImageUrl_AddReg
CopyFiles=CopyImageUrl_CopyFiles
[CopyImageUrl_CopyFiles]
CopyImageUrl.html
[CopyImageUrl_AddReg]
HKCU,"Software\Microsoft\Internet Explorer\MenuExt\复制图片链接",,0x00000000,"%10%\web\CopyImageUrl.html"
HKCU,"Software\Microsoft\Internet Explorer\MenuExt\复制图片链接","contexts",1,02
第三步:在CopyImageUrl.inf上右键,选择“安装”,然后重启IE浏览器即可。

posted on 2010-09-13 22:12  网络小筑  阅读(339)  评论(0编辑  收藏  举报

导航