Repository navigation
Conversation
A command started from the native context menu or a keyboard shortcut is run by the content script, so chrome.sidePanel.open() was called after the user gesture was lost. Open the side panel with a blank page synchronously in the event handler, and let the later openSidePanel request only set the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pd1sH2SVL35AWHUxzVCAqk
- Refresh the side panel shortcut cache when the shortcuts are changed. - Do not let a stale open() failure clear a newer pre-opened state. - Move test-only exports to __test and fix test names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pd1sH2SVL35AWHUxzVCAqk
- Respond to executeAction, so the sender can tell a tab without the content script and close the pre-opened side panel at once. - Keep an already open side panel instead of replacing it with a blank page, and do not close it when the command does not run. - Skip the delayed disable of a pre-open close when the side panel of the tab is opened again while closing. - Extend the pre-open timeout to 30 seconds for permission prompts. - Fix the service worker tests broken by the shortcut storage listener. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pd1sH2SVL35AWHUxzVCAqk
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#363 の対応。ブラウザネイティブのコンテキストメニューやキーボードショートカットから、サイドパネルを使うコマンド(通常・AI Prompt・Page Action のサイドパネルモード)を実行するとサイドパネルが開かない問題を修正。
原因
コマンドは SW → content script → SW の経路で実行されるため、
chrome.sidePanel.open()を呼ぶ時点でユーザージェスチャーが失われていた。ページ上のクリックと違い、ブラウザ UI の操作ではページにユーザーアクティベーションが付かない。対応
src/services/sidePanelPreOpen.tsを追加。イベントハンドラ内で await より前に、空白ページ(url なしの relay ページ)でサイドパネルを先に開くActionHelper.openSidePanel/chrome.openSidePanel: 事前オープン済みのタブではopen()を呼ばずsetOptionsでページだけ設定sidePanel:プレフィックスを付け、SW のコールドスタート時も同期的に判定executeActionを受け付けたらtrueを返すようにし、送信側が失敗を判別できるようにしたonClosed対応ブラウザのみ。非対応では開閉状態を正しく追えないため従来通り事前オープンする)STORAGE_KEY.SHORTCUTS)の変更でもキャッシュを更新既知の制約
確認項目
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pd1sH2SVL35AWHUxzVCAqk