Commit 810e8d3
octo-patch
fix(menus): observe sidePanel.open promise in command handler & guard against missing chrome.sidePanel
Addresses two follow-up review findings on PR #963:
1. devin-ai-integration[bot]: src/background/commands.mjs:15 had the
same unhandled-rejection pattern as menus.mjs. The keyboard command
path now mirrors the menus.mjs treatment: call the action
synchronously to preserve user-gesture context, then attach a
.catch() to the returned thenable so a rejected sidePanel.open()
does not bubble up as an unhandled rejection.
2. coderabbitai[bot]: src/content-script/menu-tools/index.mjs:62-69
called chrome.sidePanel.open directly, which throws synchronously
in browsers where chrome.sidePanel is not defined (e.g. Firefox).
Guard the call with a typeof chrome / chrome.sidePanel check and
return a rejected Promise so the caller's .catch() handles it
uniformly with API rejections.1 parent 327c967 commit 810e8d3
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
0 commit comments