<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Maximize Window :: Web Browser :: JavaScript or Browser Extension?</title>
		<link>http://www.allegro.cc/forums/view/594192</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 30 Nov 2007 20:26:59 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;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 <tt>fullscreen=yes</tt> (which is just annoying) or resizing/repositioning the Window to consume the entire screen (though it&#39;s not <i>maximized</i>, just <i>resized</i> and <i>repositioned</i>). Neither of these solutions satisfies me.</p><p>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&#39;m personally not satisfied unless the window is actually <tt>maximized</tt> so that doesn&#39;t really help me any (and I imagine other users having similar compulsions).</p><p>I&#39;m wondering if anybody knows of a way for JavaScript to <tt>maximize</tt> the browser window. Since I know you don&#39;t, I&#39;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. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// In JavaScript, perhaps...</span>
<span class="k1">try</span><span class="k2">{</span>
<span class="k2">(</span><span class="k1">new</span> ActiveXObject<span class="k2">(</span><span class="s">"Maximize.Maximizer"</span><span class="k2">)</span><span class="k2">)</span>.maximize<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span><span class="k1">catch</span><span class="k2">(</span>e<span class="k2">)</span><span class="k2">{</span><span class="k2">}</span>

<span class="c">// ...or...</span>
<span class="k2">(</span>Maximizer<span class="k2">)</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="k2">(</span><span class="k1">new</span> Maximizer<span class="k2">)</span>.maximize<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>

<span class="c">// Of course I'd prefer to extend the window object, but I doubt it's</span>
<span class="c">// possible...</span>
<span class="k2">(</span>window.maximize<span class="k2">)</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> window.maximize<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
I am fairly confident that it&#39;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&#39;t know too much about Firefox extensions, but the little bit I&#39;ve looked into them suggests they are completely JavaScript-based (and therefore, relatively powerless when it comes to maximizing the main window).</p><p>Anybody with encouraging comments gets a cookie. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Anybody with helpful resources, code samples, or productive hints gets two!*</p><p>For the record, I&#39;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).</p><p>What do you think? <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p> <sub>* Note: the two cookie offer is a complete falsification. However, you will have my gratitude.</sub>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 30 Nov 2007 00:51:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If a site starts messing with my browser window, I close it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Simon Parzer)</author>
		<pubDate>Fri, 30 Nov 2007 04:07:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Neither of these solutions satisfies me.
</p></div></div><p>
That&#39;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.</p><p>I don&#39;t know if you can do it via a Firefox extension. You&#39;re probably better off asking in a Firefox extension development forum. It might be as simple as a browser.maximize(), but I don&#39;t know if anything like that is supported.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 30 Nov 2007 04:18:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I agree with Simon.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Fri, 30 Nov 2007 04:19:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t like when windows open off-center or fullscreen. Maximized is perfect and the complete opposite of abuse, if you ask me. And it&#39;s not like I&#39;m randomly moving the window: it happens &quot;right after the window opens&quot; before you really get a chance to interact with the window. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>And for the record, this isn&#39;t a public site. It&#39;s users have specifically requested this feature.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 30 Nov 2007 06:06:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m with Simon.</p><p>I think that I know how I want my screen layed out better than some javascript does.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Fri, 30 Nov 2007 14:33:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just disable javascrapt&#39;s ability to mess with the window size/position. Since each browser &quot;window&quot; is just a tab, moving or resizing it affects more than just that window.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Fri, 30 Nov 2007 14:39:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">James Stanley said:</div><div class="quote"><p>
I think that I know how I want my screen layed out better than some javascript does.
</p></div></div><p>
The users have been manually positioning their browser <img class="math" src="http://www.allegro.cc/images/tex/9/d/9dd4e461268c8034f5c8564e155c67a6-96.png" alt="&lt;math&gt;x&lt;/math&gt;" /> times per day for years. They&#39;d like software to do it for them now (they&#39;ve all agreed that maximized is how they want it). If you don&#39;t want it maximized then you can adjust it to your preference (which you have to do currently anyway - this feature would remove the need for most of the users).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 30 Nov 2007 20:26:59 +0000</pubDate>
	</item>
</rss>
