files/en-us/mozilla/add-ons/webextensions/api/tabgroups/query/index.md
Return all tab groups or find groups with certain properties.
let group = await browser.tabGroups.query(
queryInfo // object
);
queryInfo
collapsed {{optional_inline}}
boolean. Whether the returned tab groups are collapsed or expanded in the tab strip.
color {{optional_inline}}
shared {{optional_inline}}
boolean. Whether the returned tab groups are shared.title {{optional_inline}}
string. The name of the tab groups to return.windowId {{optional_inline}}
integer. The ID of the window the returned tab group are in.A Promise fulfilled with an array of {{WebExtAPIRef("tabGroups.TabGroup")}} objects. If the request fails, the promise is rejected with an error message.
{{WebExtExamples("h2")}}
{{Compat}}