title: How can I close a window with Javascript on Mozilla Firefox 3?
body: <p>I need to close the tab which displays my webpage, by the click of a button. But firefox does not allow to close the window by javascript as long as it is not opened by javascript.
  If I set the value of <code>dom.allow_scripts_to_close_windows</code> to be "true", then even normal <code>window.close()</code> works too. But that is not a good solution. :(</p>
  
  <p>I tried the following workaround suggested in one of the forums:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  function closeWindow() {
     window.open('','_parent','');
     window.close();
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>It is supposed to fool the browser into thinking that it was actually opened by javascript, but this does not work in Firefox 3.</p>
  
  <p>Can anyone please suggest a workaround? </p>