Chrome.windows.create api does not open window according to specified state

1,279 views
Skip to first unread message

Prerna Mehra

unread,
Jun 8, 2022, 5:57:40 AM6/8/22
to Chromium Extensions
Hey everyone,

We are in manifest V3, want to open a new window using chrome.windows.create with specified options.
However state: minimized option does not seem to be working

chrome.window.create({ url: 'https://www.google.com', state: 'minimized' });

The above line does create a new window however, it is NOT minimized. It opens with current window dimensions & on top of current window.

Is there any other way to open minimized new window?

Ibrahim

unread,
Jun 8, 2022, 8:51:21 AM6/8/22
to Chromium Extensions, alice...@gmail.com
I believe this is related to this update:

It seems that all new windows must be visible and at least half of the screen size.

wOxxOm

unread,
Jun 8, 2022, 10:12:33 AM6/8/22
to Chromium Extensions, Ibrahim, alice...@gmail.com
You have a typo: window should be windows.
With the typo fixed it works correctly here.
Assuming your real code doesn't have this typo, you either have another extension that changes behavior or your browser overrides it.

Prerna Mehra

unread,
Jun 20, 2022, 7:39:41 AM6/20/22
to Chromium Extensions, wOxxOm, Ibrahim, Prerna Mehra
Even with no typo, it does not seem to work on my system. I'm using Version 102.0.5005.115 (Official Build) (64-bit) of chrome & OS is Ubuntu 20.04.4 LTS. I have literally tried a lot of times to open a new window in minimized state but it always ends up opening new active window.

Also I'm in manifest V3. Guys, know any workaround? I just want to open a new window quietly without disrupting user experience.

Fabienne

unread,
Aug 3, 2022, 10:04:55 PM8/3/22
to Chromium Extensions, alice...@gmail.com, wOxxOm, Ibrahim
Running into this issue right now as well. Did you create a bug report already?

Prerna Mehra

unread,
Aug 3, 2022, 10:45:16 PM8/3/22
to Chromium Extensions, fwilli...@gmail.com, Prerna Mehra, wOxxOm, Ibrahim
No, I haven't created bug report for this. 
Actually, the issue seems to be exists in Ubuntu 20.04.4 LTS chrome, but on macOS the same snippet works fine. I haven't tested this on windows yet.

Fabienne

unread,
Aug 4, 2022, 8:38:18 AM8/4/22
to Chromium Extensions, alice...@gmail.com, Fabienne, wOxxOm, Ibrahim
I have the issue on ChromeOS 103.0.5060.132
Haven't tested windows yet either.

Simeon Vincent

unread,
Aug 4, 2022, 11:57:29 PM8/4/22
to Fabienne, Chromium Extensions, alice...@gmail.com, wOxxOm, Ibrahim
Bug reports are always welcome :)

As a potential workaround you can create a new window and immediately update the window to minimize it.

chrome.action.onClicked.addListener(async () => {
let window = await chrome.windows.create({url: 'https://example.com'});
chrome.windows.update(window.id, {state: chrome.windows.WindowState.MINIMIZED});
});

Simeon - @dotproto
Chrome Extensions DevRel


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/f2c16012-cd06-42f2-8f15-10bafd91a354n%40chromium.org.

Manvel Saroyan

unread,
Jan 10, 2023, 6:22:58 AM1/10/23
to Chromium Extensions, Simeon Vincent, Chromium Extensions, alice...@gmail.com, wOxxOm, Ibrahim, fwilli...@gmail.com
Have stumbled on the issue today, Simeon's solution worked for me on Ubuntu 20.04 with Chromium v108.0.5359.124. Created https://bugs.chromium.org/p/chromium/issues/detail?id=1406188 just in case as I couldn't find a bug report.
Reply all
Reply to author
Forward
0 new messages