fix: swallow rejections on the tab-open and menu-registration paths

This commit is contained in:
golem 2026-08-01 22:30:37 -06:00
parent f683f2e841
commit 22fc754636

@ -52,6 +52,7 @@ async function readSelection() {
}
async function openChatGpt(query) {
try {
const settings = await load();
const url = buildChatGptUrl(settings, query);
@ -65,6 +66,10 @@ async function openChatGpt(query) {
}
await browser.tabs.create({ url, active: settings.openIn !== "background-tab" });
} catch {
// Silence rejections silently — the user expects either a tab to open or
// nothing, not an error log. Every failure path must degrade gracefully.
}
}
// removeAll() first, so a background event page waking up and re-running this
@ -96,4 +101,7 @@ if (browser.commands) {
});
}
registerMenu();
registerMenu().catch(() => {
// Silence rejections from menus.removeAll() — it cannot prevent menu creation
// on retry, so degrade gracefully with no unhandled rejection logged.
});