How can I create a new object Window, myWindowwhich is independent of Window(so the change, for example, myWindow.Array.prototypedoes not affect window.Array.prototype), without creating <iframe>?
I am currently doing this 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 would like to make my own copies of the main types of objects and prototype them.
source
share