Scripting

How to resize and center Safari with one-click

 

This tip shows you how to set Safari 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

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/alookk.

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