Support focused=false in the browser.windows.create

NEW
Assigned to

Status

()

Toolkit
WebExtensions: Frontend
P3
normal
a year ago
5 months ago

People

(Reporter: kmag, Assigned: kmag)

Tracking

(Blocks: 1 bug, {dev-doc-needed})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [windows]triaged)

Chrome creates these windows with the normal stacking order and positioning, but does not focus them.
Assignee: nobody → kmaglione+bmo
Iteration: --- → 48.1 - Mar 21

Updated

a year ago
Priority: -- → P3
Target Milestone: --- → mozilla49

Updated

a year ago
Whiteboard: [windows] → [windows]triaged
Duplicate of this bug: 1278030
Keywords: dev-doc-needed
Target Milestone: mozilla49 → ---

Updated

8 months ago
Component: WebExtensions: Untriaged → WebExtensions: Frontend

Comment 2

6 months ago
It would actually help already if the windows.create() call wouldn't error out when seeing focused=true. The Chrome documentation (and current MDN documentation since it's identical) doesn't really make it clear that creating a focused window is the default behavior. So extensions will often specify focused=true explicitly and fail in Firefox for no good reason whatsoever.
(In reply to Wladimir Palant from comment #2)
> It would actually help already if the windows.create() call wouldn't error
> out when seeing focused=true. The Chrome documentation (and current MDN
> documentation since it's identical) doesn't really make it clear that
> creating a focused window is the default behavior. So extensions will often
> specify focused=true explicitly and fail in Firefox for no good reason
> whatsoever.

Thanks for pointing this out. I've updated the docs page.
(In reply to Wladimir Palant from comment #2)
> It would actually help already if the windows.create() call wouldn't error
> out when seeing focused=true. The Chrome documentation (and current MDN
> documentation since it's identical) doesn't really make it clear that
> creating a focused window is the default behavior. So extensions will often
> specify focused=true explicitly and fail in Firefox for no good reason
> whatsoever.

Currently, we don't guarantee either that the new window receives focus or that it doesn't. In general, it does receive focus, but it's mostly up to the OS, and there are corner cases where it doesn't.
I tried to find, but it looks like we don't have platform support to "unfocus" a window, and that's the problem here, right?

But even with that, we might as well allow that option (and only do a focus if set to true), as that is what we do for windows.update() method.

http://searchfox.org/mozilla-central/source/browser/components/extensions/ext-windows.js#197
You need to log in before you can comment on or make changes to this bug.