Setting exact window size with JavaScript

Before making a screen cam with several chapters, it is a good thing to standardize the size of the video capture area. I did this once long time ago on my office laptop, but lost the JavaScript bookmark, so I thought I would make a quick note in order not to forget.

It really is very easy. Just paste this into the address bar to set the window dimension and move it to a certain spot on your monitor:


javascript:self.resizeTo(850,850);self.moveTo(290,160);

After pressing return, your browser window will adjust to the standardized dimension and move into place, so you can have different browser windows precisely overlapping and fitting your recording area on your monitor.

By the way, I found the information in the online Client-side JavaScript Reference hosted by Sun.

One Reply to “Setting exact window size with JavaScript”

  1. Maybe not surprising, but there is an exception. If you try this with Safari, Internet Explorer and Firefox, the windows will be precisely sized, but Firefox will not be positioned on top of the other windows.

    By adjusting manually, I found a difference of 22px in the positioning between Firefox and the two other browsers.In order make the windows overlap perfectly I wrote:

    IE and Safari:
    ... self.moveTo(990,60);
    Firefox:
    ... self.moveTo(990,82);

Leave a Reply

Your email address will not be published. Required fields are marked *