Skip to content

Commit

Permalink
Fixed save error while using PWA and enabled save tab groups (sienori…
Browse files Browse the repository at this point in the history
  • Loading branch information
mohemohe committed Sep 3, 2022
1 parent 0c5dce2 commit 4f7f5c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/background/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ export async function loadCurrentSession(name, tag, property) {
}

if (isEnabledTabGroups && getSettings("saveTabGroups")) {
const tabGroups = await queryTabGroups();
const filteredTabGroups = tabGroups.filter(tabGroup =>
// ポップアップやPWAにはタブ自体が存在しないので、normalタイプのウィンドウのみクエリする
const filteredWindows = Object.values(session.windowsInfo).filter(window => window.type === "normal");
const tabGroups = await Promise.all(filteredWindows.map(window => queryTabGroups({
windowId: window.id,
})));
const filteredTabGroups = tabGroups.flat().filter(tabGroup =>
Object.keys(session.windows).includes(String(tabGroup.windowId)));
if (filteredTabGroups.length > 0) session.tabGroups = filteredTabGroups;
}
Expand Down

0 comments on commit 4f7f5c4

Please sign in to comment.