Simple question, I have a window that was opened with this code
window.open(URL, windowName, 'resizable=no');
I know I can control size and position programmatically after it's loaded but how do I make it simply reziable again? is there any way to override it?
(NOTE: I have no access to modify the opening code, but have full access to the child window code)
Simple question, I have a window that was opened with this code
window.open(URL, windowName, 'resizable=no');
I know I can control size and position programmatically after it's loaded but how do I make it simply reziable again? is there any way to override it?
(NOTE: I have no access to modify the opening code, but have full access to the child window code)
Share Improve this question asked Aug 10, 2011 at 17:54 Eran MedanEran Medan 45.8k61 gold badges187 silver badges281 bronze badges 1- did you try setAttribute – zod Commented Aug 10, 2011 at 19:51
5 Answers
Reset to default 2A hack can be this:
window.open(window.location.href, document.title, 'resizable=yes');
window.close();
but it cause your window open a new window and close itself that is not a good UX
You can resize the child window like this:
self.resizeTo(width, height);
As for making the child window resizable again, I don't think you can. The parent window has control of the child.
No, whether a window is resizable is determined when it is opened. Changing this flag after the fact isn't possible. Depending on your goal opening a new (resizable) child window and closing the old one might be an option, I don't think there are any alternatives.
I can't find it in w3c site so this might be deprecated, but window.setResizable(true) should set it's own window resizeable.
Give it a try, check the link for more information on the restrictions.
The method is also listed here.
Of course that, having control over the child, you could also create a new child from it I guess, as a last resort.
var win = window.open(URL, windowName, 'resizable=no');
win.resizeTo(*yourWidth*, *yourHeight*);
you can use resizeTo to your width and height to change the window size