How can I make a new Window
object, myWindow
, that is independent to window
(so modifying e.g. myWindow.Array.prototype
does not effect window.Array.prototype
), without creating an <iframe>
?
At the moment I'm doing it as follows
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;
}
Ultimately, I'd like to make my own copies of core object types and prototype them.
Emm... you can't do that. Well... you may call window.open
, but it will open a new window. And... why do you need that at all? It looks like you are on wrong way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With