How can I create a new window object without iframes?
<p>How can I make a new <code>Window</code> object, <code>myWindow</code>, that is independent to <code>window</code> (so modifying e.g. <code>myWindow.Array.prototype</code> does not effect <code>window.Array.prototype</code>), <strong>without</strong> creating an <code>&lt;iframe&gt;</code>?</p>

<p>At the moment I'm doing it as follows</p>

<pre><code>function newWindow(){
    var myFrame = document.createElement('iframe'), myWindow = undefined;
    myFrame.style.display = 'none';
    myFrame.src = 'javascript:undefined;';
    document.body.appendChild(myFrame);
    myWindow = myFrame.contentWindow;
    document.body.removeChild(myFrame);
    return myWindow;
}
</code></pre>

<p>Ultimately, I'd like to make my own copies of core object types and prototype them.</p>
