window.open: positioning left|top not working (code works in Chrome/Edge)
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: johannes_eckert, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
262.03 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0
Steps to reproduce:
-
Went to Mozilla window.open
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
https://developer.mozilla.org/en-US/docs/Web/API/Window/open -
used sample code (changed 100 to 300 for better viewing):
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
let windowObjectReference;
let windowFeatures = "left=300,top=300,width=320,height=320";
function openRequestedPopup() {
windowObjectReference = window.open("http://www.mozilla.org/", "mozillaWindow", windowFeatures);
}
openRequestedPopup()
Actual results:
- The popup window is using not the given coordinates left|top
- The code worked in Chrome ((Version 101.0.4951.64) and Edge (Version 102.0.1245.7)
Expected results:
The popup window should be displayed at left=300 | top=300
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
We can't choose the positions on Wayland. It should work in X11 tho.
Reporter | ||
Comment 2•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)
We can't choose the positions on Wayland. It should work in X11 tho.
Thanks for your comment. As far as I can remember it worked some time ago, I could position the popup on screen, where I wanted it to be. I am building a bookmark manager and need a popup to transfer data to my browser-app via a message event, and I put the pop-up in the right bottom corner.
Reporter | ||
Comment 3•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)
We can't choose the positions on Wayland. It should work in X11 tho.
Thanks for your comment. As far as I can remember it worked some time ago, I could position the popup on screen, where I wanted it to be. I am building a bookmark manager and need a popup to transfer data to my browser-app via a message event, and I put the pop-up in the right bottom corner in order to not distract the user.
Comment 4•3 years ago
|
||
Chances are that in older versions of ubuntu you were using X11 or XWayland. What does the "window protocol" field in about:support
say?
Also, does a build from https://www.mozilla.org/en-US/firefox/new/ show the issue? That should still be using XWayland I think.
Reporter | ||
Comment 5•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
Chances are that in older versions of ubuntu you were using X11 or XWayland. What does the "window protocol" field in
about:support
say?
It says X11. As you mentioned Wayland I came across the field MOZ_ENABLE_WAYLAND and turned it on in - now the popup is located again the right bottom like in Chrome and Edge. Thanks for your time and helpful suggestions.
Also, does a build from https://www.mozilla.org/en-US/firefox/new/ show the issue? That should still be using XWayland I think.
I downloaded it, it was also saying X11, but after I changed MOZ_ENABLE_WAYLAND to true, it also worked here.
(It is big twist to work collect data from websites in the browser due security reasons. Having a sandbox like in beaker browser or a local server - see app "Web Server for Chrome" https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb would help to work in the browser, collecting data and write & email & social media in it, instead of switching to different programmes. That should on a desktop within the browser imho, rembering "hypercard")
Comment 6•3 years ago
|
||
Wait I don't understand, that should be exactly the other way around. With Wayland it's expected not to work, with X is supposed to. MOZ_ENABLE_WAYLAND should do nothing if you're on X11... Let me try to take a closer look :)
Reporter | ||
Comment 7•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)
Wait I don't understand, that should be exactly the other way around. With Wayland it's expected not to work, with X is supposed to. MOZ_ENABLE_WAYLAND should do nothing if you're on X11... Let me try to take a closer look :)
You are right ... It worked for me as I used additional obj.moveTo(x,y) to position the popup. Reason why I thought it worked: before you could see the she flashing up the pop up on the left corner for a second then appearing to the bottom right where I wanted it to be, what was distracting ux experience. After I did the change made MOZ_ENABLE_WAYLAND this distracting flahsing disappeard. So window.open still does not position the popup to the given coordinates, but this is a state I can work with. Thanks for your time and effort, if you got any ideas I am curious to learn about them.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
Description
•