Scripting

How to resize and center Safari with one-click

 

Resize Safari 5

New Window Safari Bookmarklet

Safari 5 blocks window resizing using JavaScript. A neat work around is to use the following code which will open a new Safari window sized to 1024×768.

javascript:open(location,'1024:768','innerWidth='+(1024)+',innerHeight='+(768)+','location=yes, menubar=yes, toolbar=yes');

You can also drag this bookmarklet to your Bookmark Toolbar

New 1024×768 Window

Safari 4 and older

This tip shows you how to set Safari 4 and older, to 1024px x 768px and auto-center the browser window – all with just one click.

It’s achieved by adding a new Safari Bookmark which links to a snippet of JavaScript. You can then set your browser size by just clicking on your Bookmark Toolbar. Useful for taking uniform screen-grabs or screen-captures.

The Code

  1. Open Safari
  2. Click Bookmarks > Add Bookmark. Or press Apple+D
  3. Name your bookmark |1024|
  4. For the address enter
    javascript:self.resizeTo(1024,768);self.moveTo(parseInt((screen.availWidth/2)-(1024/2)),parseInt((screen.availHeight/2)-(768/2)));
    
  5. And that’s it!

Now make sure you’ve closed any Safari tabs and then click your new bookmark. If you’ve copied it correctly, Safari will resize and jump to the center of your screen.

External Links

  1. artofgeek.com – Set Safari’s window size with one click of the mouse
  2. Mac OS X keyboard shortcuts

Sponsors

Web Hosting – £2.99/mo

Reliable UK web hosting. Free tech support. Trusted UK host since 2004. Free setup. Order online.

http://ecenica.com/

cPanel Hosting – £4.99/mo

Fast cPanel hosting with email. Choice of UK/US servers. 30-day money-back promise. Founded 2004.

http://ecenica.com/

 

Related posts:

 

Tags: , , , , , ,

Share this article

If you found this article useful, please feel free to re-tweet. The Bit.ly Url for this post: http://bit.ly/sZ6aSh.

Leave a Reply

You must be logged in to post a comment.

Still need help?

Please login to account and submit a new support ticket.

Copyright

Unless stated, this article is subject to Ecenica Hosting copyright protection. We've worked really hard to bring you this site so before you click copy & paste please take a moment to read our Copyright Notice.

Back to Top