From 24d3e7199488eef8a94a66a6bf48443cc72e2cab Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 12 Feb 2026 09:30:11 -0800 Subject: glide: Fix ‘open_or_activate’ for specific urls If the hostname is found, but the rest of the path is not, then open a new tab. Before it would assume that if we found the hostname we would also find the path, because when there is no path this is always true, but when we get open_or_activate for (for example) ‘https://github.com/ryuslash/yoshi-theme’ and there is another tab open on ‘https://github.com/emacs-slack/emacs-slack’ we can find the host, but not the path. --- glide/.config/glide/glide.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts index 644df7a..9579c06 100644 --- a/glide/.config/glide/glide.ts +++ b/glide/.config/glide/glide.ts @@ -99,10 +99,10 @@ async function open_or_activate(url) { const tabs = await glide.tabs.query({url: `*://${url.hostname}/*`}); const tab = tabs.find(t => t.url.startsWith(url.href)); - if (tabs.length === 0) { - glide.excmds.execute(`tab_new ${url}`); - } else { + if (tab) { await browser.tabs.update(tab.id, { active: true }); + } else { + glide.excmds.execute(`tab_new ${url}`); } } -- cgit v1.3-2-g0d8e