Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 902
danspants Avatar asked Jul 31 '13 02:07

danspants


2 Answers

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

like image 74
方 觉 Avatar answered Nov 03 '22 11:11

方 觉


We had the same type of difficulties. Internal webapp that opens multiple documents in windows, and need to be placed in other monitors. The javascript does not support this, for security reasons and only a native extension can properly work with the tabs/windows objects.

Therefore, we have created an open source chrome extension for doing exactly that: flexible windows position across multi-monitor setups.

It has other interesting features like templates that you can use to share best settings with other work collegues.

The chrome extension is called "MultiWindow Positioner" and its complete free. You can get it at the chrome store here

The actual source code you find in github in the project chrome-multiwindow-positioner

Disclaimer: I am the maintainer of the open source (MIT) github project. If there any interesting idea, or comments feel free to share them here.

like image 44
Igor Lino Avatar answered Nov 03 '22 12:11

Igor Lino