Javascript to resize your browser

Saw this in one of the Mac OS X mailing lists. The discussion centers around Safari but it work just as well with anything that supports JS. I’d seen this before at Bookmarklets but forgot about it until I saw it on the list. See the Bookmarklets site for a description of bookmarklets, what they are, how to use them and so on.
This will move the window to the upper left corner of the screen and resize it to 800×600 (note that 800×600 may not be the size of the actual display area of the window):

javascript:self.moveTo(0,0);self.resizeTo(800,600)

This will move and resize it so it’s an 800 pixels wide window that runs the entire height of the display:

javascript:self.moveTo(0,0);self.resizeTo(962,screen.availHeight)

self.resize or window.moveTo can be used instead to put the work into the hands of the user.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: