Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chrome extension detect second monitor

chrome.system.display.getInfo((screens) => {
  screens.forEach((screen) => {
    chrome.app.window.create("app.html", {
      outerBounds: screen.workArea // It so happens it's formatted as expected
    });
  });
});

"system.display" permission required

If you pass outerBounds.top/outerBounds.left properties to chrome.app.window.create, those actually refer to the combined coordinate space, not the current monitor. Chrome will likely clamp/shift what you pass to it to fit in the screen.
 
PREVIOUS NEXT
Tagged: #chrome #extension #detect #monitor
ADD COMMENT
Topic
Name
1+1 =