Open Bug 1770553 Opened 3 years ago Updated 1 year ago

window.open: positioning left|top not working (code works in Chrome/Edge)

Categories

(Core :: DOM: Core & HTML, defect, P3)

Firefox 100
x86_64
Linux
defect

Tracking

()

REOPENED

People

(Reporter: johannes_eckert, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0

Steps to reproduce:

  1. Went to Mozilla window.open
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    https://developer.mozilla.org/en-US/docs/Web/API/Window/open

  2. 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:

  1. The popup window is using not the given coordinates left|top
  2. 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

Component: Untriaged → DOM: Window and Location
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64
Component: DOM: Window and Location → DOM: Core & HTML

We can't choose the positions on Wayland. It should work in X11 tho.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

(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 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.

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.

Flags: needinfo?(johannes_eckert)

(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")

Flags: needinfo?(johannes_eckert)

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 :)

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---

(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.

Severity: -- → S3
Priority: -- → P3
Attachment #9381527 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: