Magic of in browsers

The window object is supported by most modern browsers. It represents the browser window. The window is the root object and every other javascript object, function, variables are members of it.

It has some properties and methods. Here, we are going to see about which we mostly use when we want to open a new window to perform some action. – open a new window and returns the windowProxy object which is the wrapper on the window object.

Syntax:, ?target, ?features) – all three params are optional.

url – url to navigate for.

target – window name – it opens a new window if a window with that name doesn’t exist otherwise simply focus the existing and reloads.

features – browser features like width, height etc.

// -> Opens up a pop-up with the mentioned URL with name JS_Articles (Its not a browser title)

const windowObj ='', 'JS_Articles', 'popup');

// -> Focus window – if the ‘JS_Articles’ window is behind the current browser then it will get focused.


// -> blur window – out focus the window as opposed to focusing.


// -> Count of windows opened in current window starting with index 0.


// -> close – to close the window


// -> closed – it returns boolean and tells whether the window has opened or closed.

Using these properties we can completely deal with a new window that we opened.

You can follow me here:

Thank you :). Happy reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

🌱 How to make sure all participants are on the same page?

Next Post

Deploy Multiple NodeJS Apps on single Server with SSL, Nginx, PM2 – Part 2

Related Posts