Reputation: 223
I have a JavaScript to re-size all my popup windows:
function resize()
{
window.resizeTo(240,230);
}
But now it is not resizing in Mozilla Firefox, but it was doing earlier, also or if the popup window is opened in a new tab, it is not resizing, also in some browsers it is not also. Is there any piece of JavaScript code which works in all scenarios and all browsers?
Upvotes: 0
Views: 227
Reputation: 5094
Firefox comes with a preference for user to allow/disallow resizing of window using Javascript. It's in Tools - Options - Content - Enable Javascript -> [Advanced].
I am not sure if resizing is disabled by default, but you might want to check your own Firefox installation first.
If it's disabled by default, then unfortunately there is nothing you could do to resize the window after it has been opened. An ugly workaround would be to open itself once again using window.open() with the preferred size though.
I'll also add that:
You can't be assured that any browser will let you control the size of windows you create. You can't even be sure you'll get a window at all - people can instruct their browsers to open all new windows as browser tabs
Source: Pointy (same source as timdream)
Upvotes: 1