diff options
| -rw-r--r-- | glide/.config/glide/glide.ts | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts index 7c6fe36..1c3449f 100644 --- a/glide/.config/glide/glide.ts +++ b/glide/.config/glide/glide.ts @@ -281,21 +281,22 @@ const search_info: Record<string, { url: string, sep: string }> = { } as const /* -* pick tabs via a selection of bookmarks and history -*/ - + * pick tabs via a selection of bookmarks and history + */ glide.keymaps.set("normal", "<leader>t", async () => { //let combined: Array<Browser.Bookmarks.BookmarkTreeNode | Browser.History.HistoryItem> = [] let combined = [] - const bookmarks = await browser.bookmarks.getRecent(20); - bookmarks.forEach(bmark => combined.push({ title: bmark.title, url: bmark.url, type: 'B' })); + const tabs = await browser.tabs.query({}); + tabs.forEach(entry => combined.push({ title: entry.title ?? 'Unnamed Tab', url: entry.url, type: 'T', favIconUrl: entry.favIconUrl })); - const history = await browser.history.search({ text: "", maxResults: 100 }); - history.forEach(entry => combined.push({ title: entry.title, url: entry.url, type: 'H' })); + const bookmarks = await browser.bookmarks.search({}); + bookmarks + .filter(bmark => bmark.type !== 'folder') + .forEach(bmark => combined.push({ title: bmark.title, url: bmark.url, type: 'B', favIconUrl: null })); - const tabs = await browser.tabs.query({}); - tabs.forEach(entry => combined.push({ title: entry.title ?? 'Unnamed Tab', url: entry.url, type: 'T' })); + const history = await browser.history.search({ text: "", maxResults: 100 }); + history.forEach(entry => combined.push({ title: entry.title, url: entry.url, type: 'H', favIconUrl: null })); // filtering const newtab = (await browser.runtime.getManifest()).chrome_url_overrides?.newtab |
