Commit 792b6bc
octo-patch
fix: call sidePanel.open() synchronously to fix context menu side panel (fixes #857)
Chrome's sidePanel.open() must be called synchronously within a user
gesture handler. Previously, the call was inside a Browser.tabs.query()
Promise callback, which breaks the user gesture chain and causes:
Error: sidePanel.open() may only be called in response to a user gesture.
Fixed by extracting the itemId before the async query and handling the
openSidePanel action synchronously at the top of the event handler,
before any async operations.1 parent 46acd1c commit 792b6bc
1 file changed
Lines changed: 12 additions & 1 deletion
File tree
- src/background
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
8 | 19 | | |
9 | 20 | | |
10 | 21 | | |
11 | | - | |
| 22 | + | |
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
| |||
0 commit comments