Closed Bug 1271047 Opened 8 years ago Closed 2 years ago

Panel window type is not opening on given position.

Categories

(WebExtensions :: General, defect, P3)

48 Branch
x86_64
macOS
defect
Points:
2

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: edoubuntu, Assigned: yuki, NeedInfo)

References

(Regressed 1 open bug)

Details

(Whiteboard: triaged)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160506004122

Steps to reproduce:

Create a webextension which uses

chrome.windows.create({ 
		url: 'https://www.google.com', 
		height: 330, 
		width: 430,
		left: screen.width-430,
		top: screen.height-330,
		type: "panel"
	});

open it with "Load Temporary Add-on" on Firefox Developer Edition, and make the extension execute the command. 


Actual results:

The panel appears in the middle of the screen, without considering the given dimensions. The panel should have ignored the specified dimensions IF the panel environment was implemented like in Chrome/Chromium ( always on top, panels auto sorting and specific 'minimize' function).


Expected results:

The panel should have followed the dimensions I've given and appeared on the bottom right corner.
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Component: Untriaged → WebExtensions
Product: Firefox → Toolkit
can you confirm
Flags: needinfo?(krupa.mozbugs)
Priority: -- → P2
I've uploaded the extension repo on github [0]

[0]https://github.com/edoardoo/keepTube
Priority: P2 → P3
Whiteboard: triaged
Assignee: nobody → amckay
Confirmed, I found the example had a few other issues so I made a simpler one (attached). Note that changing left and top works great by using window.update, so there's a valid workaround for developers until we can fix this.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(krupa.mozbugs)
Attached file window-create-example.xpi (deleted) —
Assignee: amckay → nobody
Status: ASSIGNED → NEW
It is specified in both the moz & chrome documentation that this is the behavior: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/windows/create
https://developer.chrome.com/extensions/windows

If you would like to place the window you must use a 'popup' type window, although there is a firefox bug where the left & top are ignored for the create window function.

bug referenced: https://bugzilla.mozilla.org/show_bug.cgi?id=1296036
Product: Toolkit → WebExtensions
Bulk move of bugs per https://bugzilla.mozilla.org/show_bug.cgi?id=1483958
Component: Untriaged → General

After some research I've realized that the centerscreen feature triggers this problem.

On Google Chrome windows.create() accepts left and top for popup type windows, and omitted coordinates are filled with "(left of the last normal window + 10, top of the last normal window + 10)". So my patch does same thing on Firefox, except applying centerscreen if both left and top are omitted.

Assignee: nobody → yuki
Status: NEW → ASSIGNED
Attachment #9144970 - Attachment description: Bug 1271047 - Place popup type window to the specified position → Bug 1271047 - Place "popup" type window to given coordinates

(In reply to Andy McKay from comment #3)

Note that changing left and top works great by using
window.update, so there's a valid workaround for developers until we can fix
this.

But this workaround means the window first appears in the middle of the screen and only then is moved to the wished position, making it a rather ugly hack. Or am I missing something?

Correct .. kind of annoying for users, who come and complain about it to me as add-on author .. but there's nothing I can do so far.

Whiteboard: triaged → triaged checkin-needed
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/ad64957cf655
Place "popup" type window to given coordinates r=mixedpuppy

If you want to get a patch landed, please go to the revision in Phabricator, click "Edit Revision" on the top right and add the "CheckinNeeded" tag. Thank you.

Whiteboard: triaged checkin-needed → triaged

Oh thanks! I didn't know the workflow was changed.

Backed out for failures on browser_ext_windows_create_params.js

backout: https://hg.mozilla.org/integration/autoland/rev/7f8b25d9a7668670eebfec6df1a6d63ef7527c35

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=QDtwUloKTT2VQ2y3MxwMHw.0&revision=ad64957cf6554db1fabec6692b46f1e1c2c5f5a0&group_state=expanded

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=310138911&repo=autoland&lineNumber=24865

[task 2020-07-17T09:19:15.115Z] 09:19:15 INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_windows_create_params.js | test result correct -
[task 2020-07-17T09:19:15.115Z] 09:19:15 INFO - Leaving test bound testWindowCreateParams
[task 2020-07-17T09:19:15.115Z] 09:19:15 INFO - Entering test bound testPopupTypeWithCoordinates
[task 2020-07-17T09:19:15.115Z] 09:19:15 INFO - Extension loaded
[task 2020-07-17T09:19:15.116Z] 09:19:15 INFO - Console message: Warning: attempting to write 42195 bytes to preference extensions.webextensions.uuids. This is bad for general performance and memory usage. Such an amount of data should rather be written to an external file. This preference will not be sent to any content processes.
[task 2020-07-17T09:19:15.116Z] 09:19:15 INFO - Buffered messages finished
[task 2020-07-17T09:19:15.117Z] 09:19:15 INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_windows_create_params.js | expected popup type windows are opened at given coordinates - Got 123,123 / 123,60 / 60,123 / 1450,1013 / 0,27, expected 123,123 / 123,60 / 60,123 / 1450,1050 / 0,27
[task 2020-07-17T09:19:15.117Z] 09:19:15 INFO - Stack trace:
[task 2020-07-17T09:19:15.117Z] 09:19:15 INFO - chrome://mochikit/content/browser-test.js:test_is:1327
[task 2020-07-17T09:19:15.117Z] 09:19:15 INFO - chrome://mochitests/content/browser/browser/components/extensions/test/browser/browser_ext_windows_create_params.js:testPopupTypeWithCoordinates:122

Flags: needinfo?(yuki)

The test looked to be failed due to difference of screen.width/height and screen.availWidth/availHeight. The purpose of failed assertions is asserting that the window won't be placed out of the visible area. So I've separated assertions for the purpose and just compare whether the actual coordinates are inside of the visible area instead of exact same to the expected coordinates.

I've not tested this change on the tryserver because my Mercurial access is currently disabled from my too long suspend...

Flags: needinfo?(yuki)
Points: --- → 2
Severity: normal → S3

There seems to be a new bug confusing virtual and physical pixels (at least my theory so far) when updating size and position with browser.windows.update().

Updating size and position still works correctly (or as it used to) on screens where physical and virtual pixel size are the same. But on high density screens, the behaviour has changed recently. Probably with release of Firefox 106(?).

I probably need to investigate a bit more before I officially file a bug. But looks like related to the scaling factor between logical and physical pixels.
Anyone else noticed new behaviours?

Tested on Win11 with a couple of PCs and screens. I will test a bit more on differently configured PCs the coming days (but probably still only Windows)...

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:yuki, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(yuki)
Flags: needinfo?(mixedpuppy)
Attachment #9144970 - Attachment description: Bug 1271047 - Place "popup" type window to given coordinates → WIP: Bug 1271047 - Place "popup" type window to given coordinates

I've updated the patch based on the latest mozilla-central and it also includes some fixes from review comments.

Flags: needinfo?(yuki)

Phabricator says as "This revision is now accepted and ready to land". Should I set "chckin-needed" without more review for updates?

FYI, the bug I talked about in comment 20 is (became) https://bugzilla.mozilla.org/show_bug.cgi?id=1798213
Maybe at first slightly offtopic for this bug. But on the other hand maybe a bit relevant to know if fix for 1798213 is also included when testing a fix for this bug(?)

Attachment #9144970 - Attachment description: WIP: Bug 1271047 - Place "popup" type window to given coordinates → Bug 1271047 - Place "popup" type window to given coordinates
Attachment #9144970 - Attachment description: Bug 1271047 - Place "popup" type window to given coordinates → WIP: Bug 1271047 - Place "popup" type window to given coordinates
Attachment #9144970 - Attachment description: WIP: Bug 1271047 - Place "popup" type window to given coordinates → Bug 1271047 - Place "popup" type window to given coordinates
Whiteboard: triaged → triaged, checkin-needed

I've tried setting the checkin-needed to the keyword field but the bugzilla said "Value is Not Active / The keyword value 'checkin-needed' is not active", so I added it to the whiteboard field. I couldn't find out descriptions about the checkin-needed keywoard at https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html and other documents on firefox-source-docs.mozilla.org. Is there any document for this case?

Landing has been requested.

The checkin-needed keyword got removed. Please request landing from the patch reviewer for future patch submissions, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html#pushing-the-change

Whiteboard: triaged, checkin-needed → triaged
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/424c4d51a7cd
Place "popup" type window to given coordinates r=mixedpuppy

Backed out for causing mochitest failures on browser_ext_windows_size.js

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_windows_size.js | Expected 'left' value - Expected: -50, Actual: 0 -
Flags: needinfo?(yuki)
Attachment #9144970 - Attachment description: Bug 1271047 - Place "popup" type window to given coordinates → WIP: Bug 1271047 - Place "popup" type window to given coordinates
Attachment #9144970 - Attachment description: WIP: Bug 1271047 - Place "popup" type window to given coordinates → Bug 1271047 - Place "popup" type window to given coordinates
Flags: needinfo?(yuki)
Whiteboard: triaged → triaged, checkin-needed
Whiteboard: triaged, checkin-needed → triaged
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/69deea558245
Place "popup" type window to given coordinates r=mixedpuppy
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Duplicate of this bug: 1396881
Regressions: 1811326
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: