Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHICKENFOOT

Status
Not open for further replies.
Jul 7, 2010
21
DE
Hello,

I have created with CHICKENFOOT
an automated random websurfing script for artistic purposes that visits randomly domains with 3 letters. It works great but sometimes it visits domains like this one below and it is stuck:
Any ideas how to detect and close these windows with js?
hope it is clear what I ask
thanks a lot for any answer..
 
You could potentially fire off an AJAX request (via a server-side proxy) to see what the return code / response is before visiting.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
thanks a lot for the answer..I am not a specialist in js.I found and used the script below which detects and closes the alerts and popups in firefox but not these authentication windows..Is it possible to detect and close somehow these windows with js?
like the one that appears in the above url( )
any hint highly appreciated..

Code:
function closeWindow() {
  // get the most recent window





  var win = Components.

            classes["@mozilla.org/appshell/window-mediator;1"].
            getService(Components.interfaces.nsIWindowMediator).

            getMostRecentWindow(null);

  if (win == chromeWindow) { 
    output('----'); 
    return; 

  }

 //close the window

  try {
    win.doOK()
  }catch (e) {
    win.close();

  }
}
 
It might be possible, but if it is, I don't know how.

Like I said, you might be better off firing off a request to gauge the response before visiting the page.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top