danspants danspants - 14 days ago 4
Javascript Question

Moving chrome window using an extension

I'm currently building an exclusively internal web application for my employer, wherein there is a need to display information distributed across two browser windows (a scanned document and a data entry screen).

Ideally I would like both windows to open automatically and position themselves across the users multiple screens (all of the staff using this particular application have two monitors for this very purpose). Unfortunately, javascript seems unable to position the "pop-up" window onto a second monitor. I am hopeful however that a chrome extension (all users are locked into using chrome) might be able to achieve what is necessary.

Before I go down this path, is there an alternative solution to my window positioning dilemma? Can chrome extensions do more with windows than standard javascript alone? Or should I be exploring another method of achieving this result?

Thanks!

EDIT

I've made a rudimentary test and it certainly seems to do the trick. Had I realised earlier just how simple chrome extensions were to make I would've used them all over the place.

Answer

You can specify window position with chrome.windows API. With appropriate left and top values, windows can be placed on the second monitor.