title: Window.open, while loop and window.close
body: <p>I have a problem with my firefox extension. I'm doing an extension that download a webpage, save it as PDF and then, it upload the file in a server. The problem is here: </p>
  
  <pre><code>var myWindow = window.open('chrome://xulschoolhello/content/progressmeter.xul',
  '',' top=100, left=100, height=20, width=130');                            
  while(file.exists() == false) {         
  }     
  myWindow.close();  
  </code></pre>
  
  <p>To upload the file, I need that the file exists so, I have to wait until it exists. So, I made a progress meter, to show that it's in progress but the extesion has to check if the file exists. The while loop can't be empty, and I were trying a lot of thing to keep it cheack without a firefox crash. Any idea? Thanks you a lot.</p>