chrome.windows.getCurrent returns wrong window size/position
Reported by
gabr...@gsdb.net,
Mar 16 2018
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
Steps to reproduce the problem:
chrome.windows.getCurrent or getAll return wrong window width/height/top/left on Windows if window is maximized. For some reason it says window width and height are 16px larger and window top and left are -8px (impossible since the window is maximized).
But... if window is fullscreen, getCurrent or getAll return perfect width/height/top/left. However, outerWidth and outerHeight give wrong values: 16px smaller. And screenY and screenX are +8px (!).
Example:
LINUX
My resolution = 1366x768
Task bar height = 28 (bottom)
Then outerWidth = 1366
outerHeight = 768 - 28 = 740
chrome.windows.getCurrent({}, function(win) {
console.log('Expected: ', outerWidth, outerHeight, screenY, screenX);
console.log(' Given: ', win.width, win.height, win.top, win.left);
});
// --> Expected: 1366 740 0 0
Given: 1366 740 0 0 (<---- OK!)
Now fullscreen:
// --> Expected: 1366 768 0 0
Given: 1366 768 0 0 (<---- OK!)
WINDOWS 7
My resolution = 1366x768
Task bar height = 40 (bottom)
Then outerWidth = 1366
outerHeight = 768 - 40 = 728
chrome.windows.getCurrent({}, function(win) {
console.log('Expected: ', outerWidth, outerHeight, screenY, screenX);
console.log(' Given: ', win.width, win.height, win.top, win.left);
});
// --> Expected: 1366 728 0 0
Given: 1382 744 -8 -8 (<---- FAIL!)
Now fullscreen:
// --> Expected: 1350 752 8 8 (<---- FAIL, WTF?)
Given: 1366 768 0 0 (<---- OK!)
What is the expected behavior?
chrome.windows.getCurrent should return correct size and position
What went wrong?
chrome.windows.getCurrent returns wrong size and position if maximized. If fullscreen, it returns correct values, but outerWidth, outerHeight, screenX and screenY return wrong values
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 65.0.3325.162 Channel: stable
OS Version: 16.04.3
Flash Version:
Tested with
Chrome Stable 65.0.3325.162 (Ubuntu 16.04)
Chrome Stable 65.0.3325.162 (Windows 7)
Chrome Dev 66.0.3359.26 (Ubuntu 16.04)
Canary 67.0.3372.0 (Windows 7)
,
Mar 19 2018
,
Mar 20 2018
Tested the issue on chrome reported version 65.0.3325.162 using Ubuntu 14.04 with steps mentioned below: 1) Launched chrome reported version and installed extension as provided in comment#0 2) Clicked on extension and opened Devtools, In console able to see "Excepted" and "Given" values are same and "Result:OK" @Reporter: Please find the attached screen cast for your reference and let us know if we missed anything in checking the issue, provide your feedback on it which helps us in further triaging it and let us know if this issue is specific to 16.04. Thanks!
,
Mar 20 2018
Thanks for testing it. The bug only affects Windows.
,
Mar 20 2018
I have tested it with Windows 7. I still need to test it with Windows 10.
,
Mar 20 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 22 2018
As per comment#4 and #5 checked the issue on windows 7. Able to reproduce the issue on reported chrome version 65.0.3325.162 and latest canary 67.0.3377.0 using Windows 7. Note: Issue is not seen on Mac 10.13.1 and Ubuntu 14.04. As the issue is seen from M60(60.0.3080.0) considering it as Non-Regression and marking it as Untriaged. Tentatively adding component "Platform>DevTools", please change if this doesn't suite. Requesting someone from dev team to have a look into it and help in further triaging. Thanks!
,
Mar 22 2018
++ Issue is seen on Windows 10.
,
Apr 2 2018
Doesn't seem DevTools related, maybe Extensions API or Aura.
,
Dec 28
[Extensions Triage] This should be using BrowserView::GetBounds (https://cs.chromium.org/chromium/src/chrome/browser/extensions/extension_tab_util.cc?sq=package:chromium&dr&g=0&l=463), sky@/sadrul@: Can you help triage this?
,
Jan 7
On windows maximized windows are *bigger* than the display: https://blogs.msdn.microsoft.com/oldnewthing/20150304-00/?p=44543 . |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by gabr...@gsdb.net
, Mar 16 2018FYI **Firefox** results for comparison purposes: LINUX // --> Expected: 1366 714 0 0 (OK!) *714 = 768(screen.height) - 28(taskbar) - 26(firefox bar on top) Given: 1366 714 0 0 (OK!) Now fullscreen: // --> Expected: 1366 768 0 0 (OK!) Given: 1366 768 0 0 (OK!) WINDOWS 7 // --> Expected: 1382 744 -8 -8 (FAIL!) Given: 1382 744 -8 -8 (FAIL!) Now fullscreen: // --> Expected: 1366 768 0 0 (OK!) Given: 1366 768 0 0 (OK!)