![]() |
|
Maximize Window :: Web Browser :: JavaScript or Browser Extension? |
bamccaig
Member #7,536
July 2006
![]() |
I've been tasked with automatically maximizing the Web browser window when a user first accesses a site. As far as I can tell, the best you can do with JavaScript is fullscreen=yes (which is just annoying) or resizing/repositioning the Window to consume the entire screen (though it's not maximized, just resized and repositioned). Neither of these solutions satisfies me. I personally maximize just about every window I use so I see value in this functionality as well. Currently I am forced to manually maximize the window each time I open the site. Resizing/repositioning the window is a viable solution, but I'm personally not satisfied unless the window is actually maximized so that doesn't really help me any (and I imagine other users having similar compulsions). I'm wondering if anybody knows of a way for JavaScript to maximize the browser window. Since I know you don't, I'm wondering if any of you have experience developing browser extensions (primarily IE and secondarily Firefox). I may have to do so in my spare time, but I would like to at least try to develop a browser extension with this kind of functionality (either maximize every window when it opens when a flag is set or provide a JavaScript interface to script it). Of course if I did so in my spare time it would be open source. // In JavaScript, perhaps... try{ (new ActiveXObject("Maximize.Maximizer")).maximize(); }catch(e){} // ...or... (Maximizer) && (new Maximizer).maximize(); // Of course I'd prefer to extend the window object, but I doubt it's // possible... (window.maximize) && window.maximize(); I am fairly confident that it's possible to do in IE (although it looks like an ugly process - I know next to nothing of COM objects or ATL, etc.). I don't know too much about Firefox extensions, but the little bit I've looked into them suggests they are completely JavaScript-based (and therefore, relatively powerless when it comes to maximizing the main window). Anybody with encouraging comments gets a cookie. For the record, I'd like to provide a configuration interface that allows the user to specify which sites are actually allowed to script this behavior (not that maximizing the window ever hurt anybody). What do you think? * Note: the two cookie offer is a complete falsification. However, you will have my gratitude. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Simon Parzer
Member #3,330
March 2003
![]() |
If a site starts messing with my browser window, I close it. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
Quote: Neither of these solutions satisfies me. That's the best you can get. Of course, most people view messing with the browser coordinates as an abuse, except for in controlled settings where it is expected. I don't know if you can do it via a Firefox extension. You're probably better off asking in a Firefox extension development forum. It might be as simple as a browser.maximize(), but I don't know if anything like that is supported. |
Richard Phipps
Member #1,632
November 2001
![]() |
I agree with Simon. |
bamccaig
Member #7,536
July 2006
![]() |
I don't like when windows open off-center or fullscreen. Maximized is perfect and the complete opposite of abuse, if you ask me. And it's not like I'm randomly moving the window: it happens "right after the window opens" before you really get a chance to interact with the window. And for the record, this isn't a public site. It's users have specifically requested this feature. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
James Stanley
Member #7,275
May 2006
![]() |
I'm with Simon. I think that I know how I want my screen layed out better than some javascript does. |
Kitty Cat
Member #2,815
October 2002
![]() |
I just disable javascrapt's ability to mess with the window size/position. Since each browser "window" is just a tab, moving or resizing it affects more than just that window. -- |
bamccaig
Member #7,536
July 2006
![]() |
James Stanley said: I think that I know how I want my screen layed out better than some javascript does.
The users have been manually positioning their browser -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|