右键菜单[写入注册表]读取所选文字图片并将地址发送到指定页面!

80酷酷网    80kuku.com

  菜单|页面|注册表
注册表文件

REGEDIT4


[-HKEY_CURRENT_USER oftware\Microsoft\Internet Explorer\MenuExt\+ Offline &Explorer: Download the link]

[-HKEY_CURRENT_USER oftware\Microsoft\Internet Explorer\MenuExt\+ Offline E&xplorer: Download the current page]



[HKEY_CURRENT_USER oftware\Microsoft\Internet Explorer\MenuExt]

[HKEY_CURRENT_USER oftware\Microsoft\Internet Explorer\MenuExt\asthlon-推荐给朋友]
="http://localhost/songcak/songcak/MouseAdd/index.aspx"


index.aspx 文件

<script LANGUAGE="JavaScript">
//asthlon
function getfullpath(url)
{
var iIndex=url.lastIndexOf('/');
if(iIndex!=-1)
{
return url.substring(0,iIndex+1);
}
else
return url;
}


if (external.menuArguments) {
var parentwin = external.menuArguments;
var tp = '&tp=txt';
if (parentwin.document.selection) {
var sel = parentwin.document.selection.createRange().text;
}

if (!sel) {
var sel = '';
}

var url = parentwin.location.href;
var title = parentwin.document.title;

if (parentwin.event.srcElement.tagName == "A") {
url = parentwin.event.srcElement.getAttribute("HREF");
title = parentwin.event.srcElement.innerText;
}
else if(parentwin.event.srcElement.tagName == "IMG")
{
url = parentwin.event.srcElement.getAttribute("SRC");
tp = '&tp=pic';
}
void(window.open(getfullpath(document.location.href)+'../Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie'))
} else {
//history.go(-1);
}
//window.open('add.aspx','PostTie','')
window.open(getfullpath(document.location.href)+'Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie','')
</script>



add.aspx 文件为接收请求处理文件

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: