# Newly created window gets focus even if property focused is set to false

**URL:** <https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931>\
**Category:** Add-on Support\
**Created:** [August 15, 2024, 6:16pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931 "2024-08-15T18:16:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluelemon](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/bluelemon/32/77685_2.png) [@bluelemon](https://discourse.mozilla.org/u/bluelemon)\
**Post date:** [August 15, 2024, 6:16pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/1 "2024-08-15T18:16:58Z")

</div>

I’m using Firefox Developer Edition 130.0b5 (64-bit) and don’t understand why the following code makes the newly created window have focus:

```
        if (logToConsole) console.log(`Make new tab or window active: ${contextsearch_makeNewTabOrWindowActive}`);
        await browser.windows.create({
            titlePreface: windowTitle + "'" + selection + "'",
            focused: contextsearch_makeNewTabOrWindowActive,
            url: url,
            incognito: contextsearch_privateMode
        });

```

The console log returns false.

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 15, 2024, 6:40pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/2 "2024-08-15T18:40:13Z")

</div>

Looks like a bug, and I can’t find it in the bugzilla, so it’s best to [report it there](https://bugzilla.mozilla.org/enter_bug.cgi?format=guided&product=WebExtensions&component=Frontend).

I’ve tested it in Chrome where it works.  
Also the documentation says it should work:

> **[windows.create() - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/create#focused)**
>
> Creates a new window.

But from what I can remember, it newer worked, not even in Chrome. But that was many years ago… I remember writing a workaround where I had to re-focus the original window after creating a new one.

You can also create a minimized window.

---

<div class="post-metadata">

**Author:** ![bluelemon](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/bluelemon/32/77685_2.png) [@bluelemon](https://discourse.mozilla.org/u/bluelemon)\
**Post date:** [August 16, 2024, 3:47pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/3 "2024-08-16T15:47:18Z")

</div>

Hi Juraj, it also looks like a bug to me but I haven’t had a good experience reporting bugs on Bugzilla, so I’ll leave it there.

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 16, 2024, 6:45pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/4 "2024-08-16T18:45:47Z")

</div>

Hello Olivier,  
I know what you mean 😃, sometimes I spend 1h writing a bugreport only to see it gets closed as duplicate of some 12 years old bug that will never get fixed 😃.

Or even better, it receives like P4 priority 🙂.

Pretty demotivating indeed…

---

<div class="post-metadata">

**Author:** ![bluelemon](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/bluelemon/32/77685_2.png) [@bluelemon](https://discourse.mozilla.org/u/bluelemon)\
**Post date:** [August 17, 2024, 9:21am UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/5 "2024-08-17T09:21:42Z")

</div>

Hi Juraj,

You’re spot on and I have found that some devs on Bugzilla think very highly of themselves and don’t seem keen to lend a helping hand. It’s a bit sad because the community makes some effort for Firefox to be as great as it could be.

Anyway, we don’t live in a perfect world, I guess!

Thanks again for your kind help.  
Cheers

---

<div class="post-metadata">

**Author:** ![kg\_13](https://avatars.discourse-cdn.com/v4/letter/k/b5ac83/32.png) [@kg\_13](https://discourse.mozilla.org/u/kg_13)\
**Post date:** [August 17, 2024, 4:32pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/6 "2024-08-17T16:32:26Z")

</div>

The focused: false option is not supported: [https://bugzilla.mozilla.org/show\_bug.cgi?id=1253129](https://bugzilla.mozilla.org/show_bug.cgi?id=1253129)

[https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/create#browser\_compatibility](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/create#browser_compatibility) lists the option as ignored when selecting the corresponding cell for Firefox.

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 17, 2024, 4:55pm UTC](https://discourse.mozilla.org/t/newly-created-window-gets-focus-even-if-property-focused-is-set-to-false/134931/7 "2024-08-17T16:55:48Z")

</div>

Thanks for the info!  
I see my bugzilla searching skills are still poor ☹ and if indeed reported it, it would be closed as duplicate of a 9 years old bug 😃.

Is there an easy way to search also closed bugs?

UPDATE:  
I’ve managed to create a “better” search query that does search also closed bugs and even sorts them by the last update, but it generates a ton of results 😃.

```auto
https://bugzilla.mozilla.org/buglist.cgi?query_format=specific&order=Last%20Updated&bug_status= __all__ &comments=0&list_id=17172415&content=%s

```

_(replace %s at the end with the words to search)_
