Forum Moderators: open

Message Too Old, No Replies

resizeTo doesn't work in Opera

On the Mac ... for me anyway.

         

physics

10:34 pm on Jan 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to resize the main browser window in opera and it isn't working. The simple code:

<html>
<head>
<title>test resize</title>
<script type="text/javascript">
window.resizeTo(400,400);
</script>
</head>
<body>
</body>
</html>

Does nothing... I was able to resize a popup however.
Anyone know what the deal is on this?

mrhoo

6:13 pm on Feb 1, 2007 (gmt 0)

10+ Year Member



You can override this in the control panel, but most people won't.
The default is to not allow a script's resizing a window it didn't open, in all Opera versions, now. And firefox and IE7 offer it as an option.

It's a good rule. If you didn't open the window, let the user manage its size.

physics

6:52 pm on Feb 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks mrhoo. I figured this was the case so decided to re-write the script so that the window I want to resize is a popup (not an ad though). I already had one popup so another makes sense anyway.
As an aside, I was looking through the opera options and couldn't find this option. Not that it matters really but maybe it's no longer even a n option?

Personally I think this is a bit too restrictive since web-based apps should be able to control windows ... but as long as I can still control the popups I open I guess it's OK.