diff --git a/entrypoints/sidepanel/utils/opener.ts b/entrypoints/sidepanel/utils/opener.ts index 037658a..2acba4f 100644 --- a/entrypoints/sidepanel/utils/opener.ts +++ b/entrypoints/sidepanel/utils/opener.ts @@ -68,13 +68,10 @@ async function createGroup(group: GroupItem, windowId: number, discard?: boolean createProperties: { windowId } }); - // Grouping support came in 138, tabGroups is expected to be in 139 - // TODO: Remove this check once the API is available - if (!import.meta.env.FIREFOX) - await chrome.tabGroups.update(groupId, { - title: group.title, - color: group.color - }); + await chrome.tabGroups.update(groupId, { + title: group.title, + color: group.color + }); } async function manageWindow(handle: (windowId: number) => Promise, windowProps?: Windows.CreateCreateDataType): Promise diff --git a/package.json b/package.json index e9262f7..7ef97c5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tabs-aside", "private": true, - "version": "3.0.0-rc4", + "version": "3.0.0-rc5", "type": "module", "scripts": { "dev": "wxt", diff --git a/utils/saveTabsToCollection.ts b/utils/saveTabsToCollection.ts index b887b67..f6d9f1e 100644 --- a/utils/saveTabsToCollection.ts +++ b/utils/saveTabsToCollection.ts @@ -88,17 +88,9 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt tabs.every(i => i.groupId === tabs[0].groupId) ) { - // TODO: Remove the check when Firefox 139 is out - if (!import.meta.env.FIREFOX) - { - const group = await browser.tabGroups!.get(tabs[0].groupId); - collection.title = group.title; - collection.color = group.color; - } - else - { - collection.color = "blue"; - } + const group = await chrome.tabGroups.get(tabs[0].groupId); + collection.title = group.title; + collection.color = group.color; tabs.forEach(i => collection.items.push({ type: "tab", url: i.url!, title: i.title }) @@ -123,27 +115,14 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt if (!activeGroup || activeGroup !== tab.groupId) { activeGroup = tab.groupId; + const group = await chrome.tabGroups.get(activeGroup); - // TODO: Remove the check when Firefox 139 is out - if (import.meta.env.FIREFOX) - { - collection.items.push({ - type: "group", - color: "blue", - items: [] - }); - } - else - { - const group = await browser.tabGroups!.get(activeGroup); - - collection.items.push({ - type: "group", - color: group.color, - title: group.title, - items: [] - }); - } + collection.items.push({ + type: "group", + color: group.color, + title: group.title, + items: [] + }); } (collection.items[collection.items.length - 1] as GroupItem).items.push({ diff --git a/wxt.config.ts b/wxt.config.ts index 9a50271..b84182d 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -24,7 +24,8 @@ export default defineConfig({ description: "__MSG_manifest_description__", homepage_url: "https://github.com/xfox111/TabsAsideExtension/", - action: { + action: + { default_title: "__MSG_manifest_name__" }, @@ -36,7 +37,8 @@ export default defineConfig({ "tabs", "notifications", "contextMenus", - "bookmarks" + "bookmarks", + "tabGroups" ], commands: @@ -78,17 +80,13 @@ export default defineConfig({ gecko: { id: "tabsaside@xfox111.net", - strict_min_version: "138.0" + strict_min_version: "139.0" } }; // @ts-expect-error author key in Firefox has a different format manifest.author = "__MSG_manifest_author__"; } - else - { - manifest.permissions!.push("tabGroups"); - } return manifest; }