-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Richard Neomy
committed
Nov 9, 2022
1 parent
47cc581
commit c703937
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,21 @@ import {interrupts} from './plugins/loader.mjs'; | |
}); | ||
|
||
const htabs = []; // these are tabs that will be discarded | ||
// discard-tree for Tree Style Tab | ||
if (menuItemId === 'discard-tree' && info.viewType === 'sidebar') { | ||
htabs.push(tab); | ||
await new Promise(resolve => chrome.runtime.sendMessage('[email protected]', { | ||
type: 'get-tree', | ||
tab: tab.id | ||
}, tab => { | ||
const add = tab => { | ||
htabs.push(...tab.children); | ||
tab.children.filter(t => t.children).forEach(add); | ||
}; | ||
add(tab); | ||
resolve(); | ||
})); | ||
} | ||
// discard-tree for native | ||
if (tab.highlighted && menuItemId === 'discard-tree') { // if a single not-active tab is called | ||
const tbs = tabs.filter(t => t.highlighted); | ||
|