if window is popup
<p>Is there a way to determine if the current window is a popup? This is what I have right now but for some reason it is not working. I am trying to make sure that certain pages are only shown in popup window. </p>

<pre><code>if(!opener)
window.location = 'error.php';
</code></pre>

<p>The value of opener is [object DOMWindow] even though the window is not popup.</p>
