Hello,
I'm trying to create a new firefox extention that will use the
asyncResolve function to resolve DNS names. I've a weird behavior.
What I've written seems to work for a *while* and then it stops
working and Firefox just hangs...
Here is my function:
function hello() {
var url = _content.document.URL;
var gurl = url.split("/")[2];
var obj = Components.classes["@mozilla.org/network/dns-service;
1"].getService(Components.interfaces.nsIDNSService);
var listener = {
onLookupComplete: function _onLookupComplete(request, record,
status)
{
if (record)
{
while (record.hasMore())
alert(record.getNextAddrAsString());
} else {
// NO PROPER ERROR MANAGEMENT YET
alert("Error resolving host to IP
CONNECTION??");
}
}
};
try {
var dnsRecord = obj.asyncResolve(gurl, false, listener, null);
} catch (ex) { alert("Error resolving host to IP: " + ex); }
}
Has anyone seen this problem?
Thanks
Paul
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network