if (attrlist) { attrlist = attrlist.split('|'); for (var i in attrlist) { if (attrlist && elem.getAttribute(attrlist)) alttooltiptext.push('['+attrlist+']: '+elem.getAttribute(attrlist)); } } else if ( !elem.ownerDocument.contentType.match(/^text/html//) && ( ('href' in elem && elem.href) || ('src' in elem && elem.src) ) ) { // We have a valid link (with href in it) var url = elem.href;
// ... or we have a src tag (img) if(!url) { url = elem.src; }
By raboo , # Sep 20, 2009 9:29:10 AM
By zar0ku1 , # Jan 10, 2009 11:42:20 AM
By dapxin , # Feb 18, 2008 10:25:42 PM
can you make a widget by which mouseover event would genrate the ip address, location and the coordinates of the hyperlink..........
this is actually present in firefox as an add-on.
code for ur help:-
function hostipfox_enable() {
}
function hostipfox_disable() {
}
function hostipfox_init() {
if('__hostipfox__FillInHTMLTooltip' in window) return;
const prefs = Components.classes['.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null);
var originalFillInHTMLTooltip = window.FillInHTMLTooltip;
window.__hostipfox__FillInHTMLTooltip = originalFillInHTMLTooltip;
const dnsService = Components.classes['.org/network/dns-service;1'].getService(Components.interfaces.nsIDNSService)
const nsISupportsString = ('nsISupportsWString' in Components.interfaces) ? Components.interfaces.nsISupportsWString : Components.interfaces.nsISupportsString;
window.FillInHTMLTooltip = function(elem)
{
var retval = false;
if (!elem ||
elem.namespaceURI == 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul')
return false;
try {
if (elem) {
while (elem && (elem.nodeType != Node.ELEMENT_NODE || !elem.attributes.length))
elem = elem.parentNode;
if (!elem) return false;
var attrlist = null;
try {
attrlist = prefs.getBoolPref('browser.chrome.tooltips.use_attrlist') ? prefs.getComplexValue('browser.chrome.tooltips.attrlist', nsISupportsString).data : null ;
}
catch(ex) {
}
if (attrlist) {
attrlist = attrlist.split('|');
for (var i in attrlist) {
if (attrlist && elem.getAttribute(attrlist))
alttooltiptext.push('['+attrlist+']: '+elem.getAttribute(attrlist));
}
}
else if (
!elem.ownerDocument.contentType.match(/^text/html//) &&
( ('href' in elem && elem.href) || ('src' in elem && elem.src) )
)
{
// We have a valid link (with href in it)
var url = elem.href;
// ... or we have a src tag (img)
if(!url)
{
url = elem.src;
}
if(url)
{
if(url.length > 40)
{
url = url.substring(0, 37) + '...';
}
if(url.substring(0, 4) == 'http')
{
var original = elem.label ? elem.label : elem.alt;
var hostname = elem.hostname ? elem.hostname : Components.classes[".org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(url, null, null).host;
var ipaddr = dnsService.resolve(hostname, false).getNextAddrAsString();
var tooltip = new hostipfox_Tooltip(original, url, hostname, ipaddr, 'loading...');
retval = tooltip.update();
tooltip.getLocation(ipaddr);
}
}
}
}
}
catch(e) {
}
if(!retval) return originalFillInHTMLTooltip(elem);
else return true;
};
}
reach me at yahoo, with
bap_g.com
take care
By mail2rajeev , # Feb 23, 2007 9:04:45 PM
By cyberfly , # Nov 17, 2006 8:45:28 PM
By CatmandOo , # Aug 7, 2006 6:58:16 PM
By Darken , # Jul 22, 2006 6:12:00 PM
By Michaeldee , # Jul 12, 2006 1:48:17 AM
By seifip , # Jul 5, 2006 1:02:24 PM
By padule , # Jul 4, 2006 9:41:28 AM
By Darken , # Jul 3, 2006 11:20:11 PM
By vincentvankooten , # Jul 3, 2006 4:04:32 PM