右键菜单[写入注册表]读取所选文字图片并将地址发送到指定页面!
2024-07-21 02:15:50
供稿:网友
注册表文件
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 文件为接收请求处理文件