Closed Bug 1855371 Opened 1 year ago Closed 7 months ago

[WebExtensions] browser.windows placement bug

Categories

(WebExtensions :: Untriaged, defect)

Firefox 109
defect

Tracking

(firefox118 affected, firefox119 affected, firefox120 affected)

RESOLVED WONTFIX
Tracking Status
firefox118 --- affected
firefox119 --- affected
firefox120 --- affected

People

(Reporter: shadedblink, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

Year ago I created a bug https://bugzilla.mozilla.org/show_bug.cgi?id=1797556
In process of fixing this bug windows placement API was broken down, so windows can't be created outside of display bounds anymore. This is not a fix for forementioned bug, since it is still reproducible.
Thus it should be reverted.

STR:

  1. Create a temp addon.
  2. Run this code in addon console:
browser.windows.create({
left: -100000,
top: -100000,
width: 1920,
height: 1080,
url: 'https://microsoft.com'
})

Actual results:

Location is ignored, window appears in visible area.

Expected results:

Location should be respected, window should appear outside of visible area.

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

Hello,

I reproduced the issue on the latest Nightly (120.0a1/20230928215127), Beta (119.0b2/20230927091517) and Release (118.0.1/20230927232528) under Windows 10 x64 and Ubuntu 22.04 LTS.

On Windows I have a 3-monitor setup, my main monitor being on the far right. The window is created on the third monitor (far left) but inside the visible area (the window basically fits the third monitor).
On Linux, I have only a monitor and the window is also created inside the visible area, right in the center.

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1271047

(In reply to William Durand [:willdurand] from comment #3)

It looks like we did that on purpose in Bug 1271047, at least based on https://searchfox.org/mozilla-central/rev/95787423bc1c7ba895ef9c6918feb054866d9f41/browser/components/extensions/parent/ext-windows.js#30?

Hey Shane, do you recall the rationale from Bug 1271047 to introduce this change in behavior on purpose?

it would be good to confirm that we do have introduced in on purpose and what are the motivations behind that choice, so that we can explicitly capture them in a bugzilla comment, and also consider to mention it in the API docs related to the underlying WebExtensions windows API.

Flags: needinfo?(mixedpuppy)

Not really, but maybe this comment has some context. https://phabricator.services.mozilla.com/D73419#2314643
Just a quick look at the bug and review, it was probably along the lines of "we shouldn't allow extensions to create hidden windows by placing them off screen"

Flags: needinfo?(mixedpuppy)

This seems to be working as intended so I am going to close this bug. That said, I'd be curious to know what would be the use case for an extension to create a window that isn't visible by users?

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → WONTFIX

(In reply to William Durand [:willdurand] from comment #6)

This seems to be working as intended so I am going to close this bug. That said, I'd be curious to know what would be the use case for an extension to create a window that isn't visible by users?

Hello. I need to render certain tabs to use them as previews on home screen, i.e. speed dial. There was a great extensions back in times of XUL called Speed Dial, but then firefox switched to webextensions and left support of background page rendering. Now there is no way to create such previews unless you want to watch them rendering all the way.
I use this extension to monitor all my networks, comics and etc. on single page to see changes visually. It is much more handy than adding API integration with each site since all I have is to add given url to bookmarks.
Today there is no way to render such pages silently since firefox first lost its ability to render without window(at XUL migration), then it restricted flag focused: false in browser.windows.open()(sometime later), then firefox broke rendering of any windows without focus(1.5-2 years ago, https://bugzilla.mozilla.org/show_bug.cgi?id=1797556 ), and when I notified mozilla about last bug, mozilla just went further and restricted creation of invisible windows at all. I trully regret that bugreport, atleast I could have stayed on actual firefox version, as now I am forced to use v93.

You need to log in before you can comment on or make changes to this bug.