How to Set the Window Size and Position of a Chrome Application Shortcut
Now that I’ve moved into the Android world, I’ve been using Google/Gmail’s “Tasks” feature to keep track of my To Do Lists. I prefer this method to a separate stand-alone ToDo app because it’s clean & simple, and it’s one less app to manage.
I created a Chrome Application Shortcut to my Task List for easy desktop access to my To Do lists, but was dismayed to discover that the window that opened was much larger than I wanted, and it was always in an inconvenient position. I would have to resize & move the window each time I used the Application Shortcut, because Chrome never seemed to remember the previous window settings.
I searched around for a guide on how to set the window size for application shortcuts, and to my surprise, there are no solutions out there. Not only does the “Application Shortcut” feature lack this functionality, but Chrome itself doesn’t even have a startup switch for setting the window size. Both seem like they’d be pretty essential features for “Application Shortcuts” to be useful, don’t you think?
I created my own method of automatically setting the window size and position using an intermediary javascript file. It sets the window size & position, then loads your preferred target URL. Here’s how to do it.
Step One: Create the Application Shortcut as you normally would.
In my case, I wanted to create an Application Shortcut to Gmail’s Tasks, so I browsed to the appropriate page:
And in Chrome, choose Wrench->Tools->Create Application Shortcuts.
Step Two: Create the intermediary HTML file on your local computer.
Next, you need to create a local HTML file on your computer that resizes the window, moves it to the desired position, and then redirects to your application shortcut URL. Here’s the file you’ll need to create:
<html> <head> <script language="JavaScript"> window.resizeTo(300,400); window.moveTo(1380,0); window.location = "https://mail.google.com/tasks/ig"; </script> </head> <body> <h1>If you see this, the redirect did not work properly.</h1> </body> </html>
Edit the file to reflect the size & position you’d like to set. The format is window.resizeTo(WIDTH, HEIGHT) and window.moveTo(X POSITION, Y POSITION). If you don’t want to set an initial startup position, just remove the window.moveTo line.
You’ll also have to set the redirect target. The one listed in the above example is the one you’ll want to use for the Gmail Tasks application. To get the link for other applications, check the properties of the shortcut that you created in step 1.
Save the file somewhere where it won’t get deleted & remember the name & location. I created a directory within “My Documents” called “Google Tasks Shortcut” and named the file “google_tasks_launcher.html”.
Step Three: Change the Application Shortcut to point to the intermediary file.
Now edit the Application Shortcuts you created in Step 1 to instead point to the intermediary HTML/javascript file. Right click on the shortcut and choose “Properties.” Then from the shortcut tab, change the Target field to point to the file you created in Step 2.
You need to change the value after the “-app” switch. In my case, I changed it as follows.
Old Value:
“C:\Documents and Settings\eddie\Local Settings\Application Data\Google\Chrome\Application\chrome.exe” –app=https://mail.google.com/tasks/ig
New Value:
“C:\Documents and Settings\eddie\Local Settings\Application Data\Google\Chrome\Application\chrome.exe” –app=file:///C:/Documents%20and%20Settings/eddie/My%20Documents/Google
%20Tasks%20Shortcut/google_tasks_launcher.html
I’ve bolded the parts that have changed.
You can also change the Application Shortcut icon on this screen if that strikes your fancy.
Hit “OK” and you should be set. Your shortcut should now open at the size & position specified in the javascript portion of the HTML file.



July 1st, 2011 at 2:20 am
sir . . can you plss make one for battlepunks on facebook? . . really wanted to create but i cant seem to understand tutorials a bit more clearer . . thanks in advance . .
July 3rd, 2011 at 4:47 am
Thank you very much, works great!
Chrome always placed the windows of the applications at a position, that part of the window was behind the taskbar (strange bug…) so I had to move the window manually to be able to access the bottom border of the window. With this html workaround file I can place it to a proper position, finally.
July 17th, 2011 at 5:00 pm
The positioning was always stored for web apps in previous versions. For some reason the feature hasn’t worked in the last couple versions, or maybe just the most recent. I’m hoping it’s fixed in 14+. (On Beta Channel, Chrome 13 currently)
July 28th, 2011 at 9:31 am
Can I just say thank-you but the only change I made was to use the canvas tasks page, much more useful in this view imo…
https://mail.google.com/tasks/canvas
Thanks once again!
August 14th, 2011 at 2:20 am
You sir are one clever genius. After reading this article (and struggling with the inability to re-size application shortcuts for the LONGEST time), I must say i had one of those ‘Why didn’t I think of that’ moments. Thank you very much, this is a clever and sensible solution! Well Done!
Thanks again!
August 15th, 2011 at 11:28 pm
Excellent. I have been looking for a solution to this problem. I applied your fix, but found that the icon would switch to the grey globe. After some fiddling, I managed to have the GMail icon stay.
Thanks!
August 19th, 2011 at 11:51 am
Outstanding tip – thank you! One question: how do I change the plain white background to black?
Thanks again Eddie – you rock!
August 27th, 2011 at 2:04 pm
This was the ONLY solution I found that works perfectly. It works great.
September 29th, 2011 at 1:28 pm
Any idea how to change the X,Y position to get it to move to a second monitor? I changed the X to double but it remains on the primary monitor?
October 9th, 2011 at 2:23 pm
thanks, worked a treat.. this has been frustrating me since v13 as prior to that it worked fine. will use your method for resizing other things as well now…
October 11th, 2011 at 12:02 pm
Works perfect! Much appreciated
October 18th, 2011 at 7:14 am
Appericiate :D.. Thankyou.
October 19th, 2011 at 2:35 pm
Thank you very, very much! Works great.
October 31st, 2011 at 11:09 am
i know you answered this before but the answer does not show up…
Any idea how to change the X,Y position to get it to move to a second monitor? I changed the X to double but it remains on the primary monitor?
November 1st, 2011 at 10:32 pm
The method now brings up a second window with a different task icon. If you pin the second icon on the task bar, and unpin the original one, the second icon will revert to chrome (since it is a chrome instance)
This is tested on Windows 7 prof 64bit
November 10th, 2011 at 2:22 pm
Thanks so much for sharing this method with us. I was bashing my brains against it, trying to figure out what I knew must be possible, and this got me there. Works perfectly in Win7 64-bit.
November 20th, 2011 at 4:59 pm
Javascript in action :D
November 29th, 2011 at 12:01 am
Thanks! Worked great.
December 2nd, 2011 at 3:47 pm
This is excellent. Now if I can just figure out why zoom changes all the apps but leaves Tasks alone.
December 4th, 2011 at 10:09 pm
Still no idea how to move it to a secondary screen?
See also 2 questions above:
Any idea how to change the X,Y position to get it to move to a second monitor? I changed the X to double but it remains on the primary monitor?
Other than that problem this was excellent!
December 5th, 2011 at 2:17 pm
Or, install Chrome Canary and use it for apps — it remembers app window size/position fine.
December 9th, 2011 at 8:52 pm
[...] target URL. Here’s how to do it. Step One: Create the Application Shortcut as you normally would. How to Set the Window Size and Position of a Chrome Application Shortcut – Eddie On Everything home • contact • blog • fb • twitter to experience pearltrees [...]