Managing Windows and Frames

Unless the permission has been granted, most modern browsers block a new window tab from popping up by default, when the open() function is called.


RESETRUNFULL
Boolean features may also be declared directly without =, or with ‘yes’, eg.:
     var features = “scrollbars, noopener=yes";

<!DOCTYPE html><html><head></head><body>
    <script>
        features="left=100,top=100,width=1000,height=500,
                                            menubar=1,toolbar=1,location=1,status=1,
                         resizeable=1,scrollbars=1,noopener=0,
                       noreferrer=0";
        var mywindow =
                        open("window.html","MyWindow",features);
        name = "Originator";
        document.write("self: "+self.name+"<br/>");
        document.write("window: "+name+"<br/>");
        document.write("parent: "+parent.name+"<br/>");
        document.write("top: "+top.name+"<br/>");
        var iid = setInterval(()=>{
            if (mywindow.closed) {
                alert("The window has been closed.");
                clearInterval(iid);
            }
        },1000);
    </script><a href="//google.com" target="MyWindow">
      Link to Google at new window.</a><br/><a href="javascript:mywindow.close()">
      Close window</a></body></html>

<!-- window.html --><!DOCTYPE html><html><head></head><body><iframe src="js_iframe.html" onload='alert("window[0]:"+window[0].document.title+"<br/>");'></iframe><br/>
    <script>
        document.write("self: "+self.name+"<br/>");
        document.write("window: "+window.name+"<br/>");
        document.write("opener: "+opener.name+"<br/>");
        document.write("parent: "+parent.name+"<br/>");
        document.write("top: "+top.name+"<br/>");
        document.write("length: "+length+"<br/>");
        document.write("frames count: "+
                                  frames.length+"<br/>");
    </script></body></html>

<!-- js_iframe.html --><!DOCTYPE html><html>
    <head>
        <title>FRAMED</title>
    </head><body>
    <script>
        document.write("self: "+self.name+"<br/>");
        document.write("window: "+window.name+"<br/>");
        document.write("parent: "+parent.name+"<br/>");
        document.write("top: "+top.name+"<br/>");
        document.write("frames: "+length+"<br/>");
    </script></body></html>