这里是geturl.htm中的内容。
<script language="VBScript">
Sub OnContextMenu()
On Error Resume Next
set srcEvent = external.menuArguments.event
set EventElement = external.menuArguments.document.elementFromPoint(srcEvent.clientX, srcEvent.clientY)
set objNetSamp=CreateObject("NetSamp.NetAPI"
if srcEvent.type = "MenuExtAnchor" then
set srcAnchor = EventElement
do until TypeName(srcAnchor)="HTMLAnchorElement"
set srcAnchor=srcAnchor.parentElement
Loop
Call objNetSamp.AddUrl(srcAnchor.href,srcAnchor.innerText)
elseif srcEvent.type="MenuExtImage" then
if TypeName(EventElement)="HTMLAreaElement" then
Call objNetSamp.AddUrl(EventElement.href,EventElement.Alt)
else
set srcImage = EventElement
set srcAnchor = srcImage.parentElement
do until TypeName(srcAnchor)="HTMLAnchorElement"
set srcAnchor=srcAnchor.parentElement
if TypeName(srcAnchor)="Nothing" then
call objNetSamp.AddUrl(srcImage.href,srcImage.Alt)
exit sub
end if
Loop
Call objNetSamp.AddUrl(srcAnchor.href, srcImage.Alt)
end if
elseif srcEvent.type="MenuExtUnknown" then
set srcAnchor = EventElement
do until TypeName(srcAnchor)="HTMLAnchorElement"
set srcAnchor=srcAnchor.parentElement
if TypeName(srcAnchor)="Nothing" then
Call objNetSamp.AddUrl(EventElement.href,EventElement.innerText)
exit sub
end if
Loop
Call objNetSamp.AddUrl(srcAnchor.href,srcAnchor.innerText)
end if
end Sub
call OnContextMenu()
</script>