Maximize browser in code

Is there a way to maximize the browser window in code when a web app starts?

If not, should I use Javascript? Following doesn’t work:

ExecuteJavaScript("window.moveTo(0, 0);window.resizeTo(screen.width, screen.height);")

I think the self.maximize is for Desktop apps only. Should I do a feature request for a maximize that works with web apps?

[Note: Screen(0) options show up in Xojo IDE for web app even though they aren’t really available. Is this by design?]

Generally speaking, no, you shouldn’t do this. The browser window is not yours to control, it is the user’s. For that reason, many browsers prevent such a thing. So while I won’t say it’s completely impossible, you’ll be fighting an uphill battle.

And be prepared to get very loving reactions of the users of your application.

Okay, thanks for the response. It turns out that some of my users aren’t figuring out on their own that they need to press the Maximize button to use the app (the app requires minimum of 800x600). I will give them a message telling them to use the Maximize button.

Also, I want to be clear. I am not talking about fullscreen (which hides menus, toolbars, etc).

I guess this is one area where expected behavior for Desktop apps is different than Web apps. I don’t really understand why but I guess I have to live with it.

Thanks again.

Malicious websites often do this, that why it upsets the user.

[quote=143920:@Ken Gish]Is there a way to maximize the browser window in code when a web app starts?

If not, should I use Javascript? Following doesn’t work:

ExecuteJavaScript("window.moveTo(0, 0);window.resizeTo(screen.width, screen.height);")

I think the self.maximize is for Desktop apps only. Should I do a feature request for a maximize that works with web apps?

[Note: Screen(0) options show up in Xojo IDE for web app even though they aren’t really available. Is this by design?][/quote]

Have a look there
http://www.htmlgoodies.com/beyond/javascript/article.php/3471151/MinimizeMaximize-a-Browser-Window.htm

But if I were you, I would not maximize the window without asking the user. It is as rude as, say, an app that would open a maximized file window on your desktop. What you may want to do is ask nicely, something like “This app is much better enjoyed with a larger window. Click here to resize”.

[quote=143935:@Ken Gish]Okay, thanks for the response. It turns out that some of my users aren’t figuring out on their own that they need to press the Maximize button to use the app (the app requires minimum of 800x600). I will give them a message telling them to use the Maximize button.

Also, I want to be clear. I am not talking about fullscreen (which hides menus, toolbars, etc).

I guess this is one area where expected behavior for Desktop apps is different than Web apps. I don’t really understand why but I guess I have to live with it.
[/quote]
With a desktop app that IS your app running & you can tell it to maximize the window.
With as web app its Safari, IE, Chrome or Mozilla or some other application - not the one you wrote.
Your CONTENT is IN the browser.
But the browser is not yours to do with as you please.

My Australian bank account (St George) expands the browser to full screen!

I already hate apps that do that, it is not to tolerate it from web sites…