Can I change the immutable existing browser window with the ability to resize Javascript?

A simple question, I have a window that was opened with this code

window.open(URL, windowName, 'resizable=no'); 

I know that I can control the size and position programmatically after loading, but how can I do this just reziable again ? is there any way to override it?

(NOTE: I do not have access to change the opening code, but I have full access to the code of the child window)

+6
source share
5 answers

Hacking can be as follows:

 window.open(window.location.href, document.title, 'resizable=yes'); window.close(); 

but it makes the window open a new window and close itself, which is not a good UX

+2
source

You can resize the child window as follows:

 self.resizeTo(width, height); 

Regarding resizing the window of the child window, I do not think this is possible. The parent window controls the child.

+1
source

No, does the window resize when it opens. Changing this flag after the fact is impossible. Depending on your purpose, opening a new (resizable) child window and closing the old one may be an option, I don't think there are alternatives.

+1
source

I can not find it on the w3c website, so it may be outdated, but window.setResizable (true) should set its own window with resizing ability.

Try checking out the link for more information on limitations.

This method is also listed here .

Of course, having control over the child, you can also create a new child out of him, as it seems to me, as a last resort.

+1
source
 var win = window.open(URL, windowName, 'resizable=no'); win.resizeTo(*yourWidth*, *yourHeight*); 

you can use resizeTo for your width and height to resize the window

0
source

Source: https://habr.com/ru/post/894745/


All Articles