Repository navigation
Conversation
Vivaldi appends an absolute URL passed to chrome.sidePanel.setOptions({ path })
to the extension origin, so the side panel showed ERR_FILE_NOT_FOUND
(chrome-extension://<id>/https://...). Chrome resolves it as a URL instead,
but blocks a side panel extension page from navigating to a web URL.
Open a relay page bundled with the extension first. When the side panel is
hosted as a tab (Vivaldi), it navigates to the target URL by itself.
Otherwise (Chrome), it asks the service worker to set the URL as the path
directly, and the result is cached so later opens skip the relay page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pd1sH5ArKQDueJGVC1vMCK
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # packages/extension/src/service_worker.ts Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
|
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.
概要
Vivaldi で結果をサイドパネルに表示しようとすると、
ERR_FILE_NOT_FOUNDになる問題を修正します(サポート問い合わせ。Vivaldi 8.3.4191.44 / Selection Command 1.4.1)。原因
chrome.sidePanel.setOptions({ path })に外部 URL(https://...)をそのまま渡していました。pathは仕様上、拡張パッケージ内のリソースを指定するものです。pathに外部 URL を渡した場合chrome-extension://<id>/https://...→ ERR_FILE_NOT_FOUND対応
サイドパネルではまず拡張内の中継ページ(
src/side_panel_relay.html)を開き、そこから表示先 URL に切り替えます。chrome.tabs.getCurrent()でサイドパネルがタブとして扱われているかを調べます。Vivaldi ではタブが返り、Chrome ではundefinedが返ります。location.replace(url)で自分で移動します。sidePanelRelayFallbackを送り、Service Worker がpathに URL を直接設定します。chrome.storage.local(sidePanelDirectUrl)とメモリに保存します。2 回目以降は中継ページを経由せず、従来どおり直接設定します。つまり Chrome で中継ページを経由するのは最初の 1 回だけです。sidePanel.open()をユーザー操作の扱いのまま呼ぶ必要があり、setOptionsは同期的に呼ばなければなりません。そのため判定結果は Service Worker 起動時にメモリに読み込んでおきます。sidePanelRelayFallbackは、送信元が自分の拡張の中継ページで、URL が http(s) の場合にだけ受け付けます。タイムアウトで判定しなかった理由: Chrome では移動を止められても何のシグナルも出ません。Navigation API の
committed/navigateerrorも発火しません。タイムアウトで判定すると、Vivaldi で表示に時間がかかるサイト(Gemini など)を「移動できなかった」と誤判定してしまいます。動作確認
ヘッドレス起動のブラウザで、ビルド済みの拡張を読み込んで確認しました。どちらのブラウザでも、サイドパネルの表示先が
http://127.0.0.1:8765/target.htmlになることを確認しています。chrome-extension://<id>/http://...になることを再現(問い合わせ内容と一致)yarn test/yarn lintが通る(lint は既存の warning のみ)補足・未対応
sender.tabが付きます。そのためisSidePanel()は「サイドパネルではない」と判定し、useSidePanelNavigationによるリンクの横取りは働きません。ただし Vivaldi ではサイドパネル内の通常の遷移がそのまま動くので、実害はないと考えています。serviceWorker-sidePanel.ts)は、Vivaldi では確認していません。🤖 Generated with Claude Code
https://claude.ai/code/session_01Pd1sH5ArKQDueJGVC1vMCK