feat(browser): replace the preview proxy with a real browser panel and an agent web tool (#2883)
The preview panel worked by proxying a dev server through OpenChamber's own origin and rewriting the HTML that came back. Anything the rewriter did not anticipate broke, and pages that refuse to be embedded never loaded at all. This deletes the proxy (-1604 lines and its tests) and merges the preview and browser panels into one surface backed by a real Chromium view. What the panel is now - A `<webview>` in its own session partition: logins and cookies persist, hot reload works because nothing is rewritten, DevTools are one click away. - Annotation: pick one element, drag a region, or draw freehand, write a note, and it reaches chat with a screenshot of the visible page with the marks on it. - Toolbar: hard reload, page zoom, device sizes, a light/dark switch that applies to the page rather than the app, and cookie/cache clearing scoped to the panel alone. - Several pages at once, each tab showing the page's own favicon, and an address bar that suggests pages already visited in this project. - Dev servers are listed from what is actually listening on the machine, checked against what a project announced, so a server is offered no matter how it was started. One that is still starting is waited for instead of failing. Remote dev servers The desktop app binds a local port and pipes raw bytes to the OpenChamber host over the existing authenticated connection, so the page keeps its own origin at the root of its own host. The reachable set is exactly what discovery reports and is re-checked per connection, so an authenticated client cannot dial arbitrary local services on the host. Links and redirects to another loopback port stay on the machine that served the page. A tunnel that cannot be opened is reported; it is never replaced by the plain loopback URL, which would answer from the user's own machine under a remote address. Agent control Browser actions are a separate `openchamber_web` tool: open, snapshot, click, type, scroll, inspect computed styles, resize between mobile/tablet/desktop, and capture a screenshot into `.openchamber/screenshots/` in the project. The existing `openchamber` tool keeps sessions, worktrees and scheduled tasks. Each has its own setting in the new Settings -> General -> OpenChamber Tools section, and the plugin is not injected at all when both are off. Capability belongs to the connected client, not to configuration: a client declares on its event stream that it can drive a page, which only a Chromium host does. Exactly one client performs each request — it claims the request before acting, and the first claim wins — because deciding by whose result arrives first would be too late for a click that already happened. No client listening is answered immediately with an explanation rather than a timeout. Runtime boundaries Web tabs get a plain iframe that can display a page but not inspect one. The VS Code extension no longer offers the surface at all, since nothing that makes the panel worth having works there. Mobile is unaffected. Native boundary Camera, microphone, location and device-picker requests from panel pages are denied — Electron grants them by default when no handler is set, and the panel loads whatever address the user types. Page capture, appearance emulation and storage clearing verify that their target belongs to the panel's own session instead of trusting a web-contents id from the renderer. Persisted state Stored `preview` tabs migrate to `browser` (v13 -> v14). Context panel tab limits are now per surface, so filling one surface no longer evicts another's tabs. Address history is stored per project and per runtime. Documentation `preview.mdx` and `desktop-browser.mdx` rewritten across all locales, the agent tool settings path corrected, new `DOCUMENTATION.md` for the browser-control broker and the dev tunnel, and the `ui-api-decoupling` skill updated where it still described the deleted proxy.
This commit is contained in:
committed by
GitHub
parent
50613bb170
commit
a5aa32446d
@@ -1192,9 +1192,62 @@ export const dict: Record<I18nKey, string> = {
|
||||
'contextRail.editorTree.toggle': 'ファイルツリーの表示切替',
|
||||
'contextPanel.browser.open': 'ブラウザパネルを開く',
|
||||
'contextPanel.browser.addressAria': 'ブラウザアドレス',
|
||||
'contextPanel.browser.history.label': '最近のアドレス',
|
||||
'contextPanel.browser.history.forget': '履歴から削除',
|
||||
'contextPanel.browser.newTab': '新しいブラウザタブ',
|
||||
'contextPanel.browser.empty': 'ウェブブラウザ',
|
||||
'contextPanel.browser.emptyHint': '上のアドレスバーにURLを入力してウェブを閲覧',
|
||||
'contextPanel.browser.inspectUnavailable': 'このページはブラウザパネルから検査できません。',
|
||||
'contextPanel.browser.back': '戻る',
|
||||
'contextPanel.browser.forward': '進む',
|
||||
'contextPanel.browser.reload': '再読み込み',
|
||||
'contextPanel.browser.hardReload': 'キャッシュを無視して再読み込み',
|
||||
'contextPanel.browser.zoomIn': '拡大',
|
||||
'contextPanel.browser.zoomOut': '縮小',
|
||||
'contextPanel.browser.zoomReset': 'ズームをリセット',
|
||||
'contextPanel.browser.clearCookies': 'Cookie を削除',
|
||||
'contextPanel.browser.clearCache': 'キャッシュを削除',
|
||||
'contextPanel.browser.clearedCookies': 'Cookie を削除しました',
|
||||
'contextPanel.browser.clearedCache': 'キャッシュを削除しました',
|
||||
'contextPanel.browser.clearFailed': '閲覧データを削除できませんでした',
|
||||
'contextPanel.browser.stop': '停止',
|
||||
'contextPanel.browser.openExternal': 'システムブラウザで開く',
|
||||
'contextPanel.browser.devTools': 'DevTools を開く',
|
||||
'contextPanel.browser.deviceToolbar': 'デバイスツールバー',
|
||||
'contextPanel.browser.device.preset': 'デバイスプリセット',
|
||||
'contextPanel.browser.device.responsive': 'レスポンシブ',
|
||||
'contextPanel.browser.device.width': 'ビューポートの幅',
|
||||
'contextPanel.browser.device.height': 'ビューポートの高さ',
|
||||
'contextPanel.browser.device.rotate': '回転',
|
||||
'contextPanel.browser.device.schemeSystem': '自動',
|
||||
'contextPanel.browser.device.schemeLight': 'ライト',
|
||||
'contextPanel.browser.device.schemeDark': 'ダーク',
|
||||
'contextPanel.browser.device.schemeFailed': 'ページの外観を変更できませんでした',
|
||||
'contextPanel.browser.frameTitle': 'ブラウザ',
|
||||
'contextPanel.browser.loadFailed': 'このページを読み込めませんでした',
|
||||
'contextPanel.browser.waitingForServer': '開発サーバーを待っています',
|
||||
'contextPanel.browser.waitingForServerHint': 'まだ接続を受け付けていません。受け付け次第このページを読み込みます。',
|
||||
'contextPanel.browser.tunnelFailed': 'この開発サーバーに接続できませんでした',
|
||||
'contextPanel.browser.tunnelFailedHint': '{url} は OpenChamber が動いているマシン上にあり、そこへの接続を開けませんでした。あなたのマシンの内容はここには表示されません。',
|
||||
'contextPanel.browser.loadFailedUnknown': 'ページに到達できませんでした。',
|
||||
'contextPanel.browser.crashed': 'このページは応答しなくなりました',
|
||||
'contextPanel.browser.crashedHint': 'ページが繰り返しクラッシュしました。再読み込みして、もう一度お試しください。',
|
||||
'contextPanel.browser.devServers.title': '実行中の開発サーバー',
|
||||
'projectActions.toast.multipleServers': '複数のサーバーが起動しました。ブラウザパネルで選んでください',
|
||||
'contextPanel.browser.devServers.justStarted': '起動したばかり',
|
||||
'contextPanel.browser.devServers.unavailable': '実行中の開発サーバーを確認できませんでした。',
|
||||
'contextPanel.browser.devServers.remoteOnly': 'これらは OpenChamber を動かしているマシン上で動作しています。開くにはデスクトップアプリが必要です。',
|
||||
'contextPanel.browser.annotate.toggle': 'ページに注釈を付ける',
|
||||
'contextPanel.browser.annotate.intro': 'これはアプリ内ブラウザで注釈を付けた選択範囲です。',
|
||||
'contextPanel.browser.annotate.attached': '注釈をチャットに添付しました',
|
||||
'contextPanel.browser.annotate.noSession': '注釈を添付する前にチャットセッションを開いてください',
|
||||
'contextPanel.browser.annotate.noPage': '注釈を付ける前にページを読み込んでください',
|
||||
'contextPanel.browser.annotate.failed': 'このページに注釈を付けられませんでした',
|
||||
'contextPanel.browser.annotate.tool.element': '要素',
|
||||
'contextPanel.browser.annotate.tool.region': '範囲',
|
||||
'contextPanel.browser.annotate.tool.draw': '描画',
|
||||
'contextPanel.browser.annotate.commentPlaceholder': '変更内容を記述...',
|
||||
'contextPanel.browser.annotate.submit': '添付',
|
||||
'contextPanel.browser.trustNotice': 'ここで開かれたページはOpenChamberへの完全なアクセス権を持ちます — 検査とスクリーンショットに必要です。信頼できるサイトのみを開いてください: 悪意のあるページがデータを読み取ったりあなたの代わりに行動したりする可能性があります。',
|
||||
'contextPanel.tab.closeTabAria': '{label}タブを閉じる',
|
||||
'contextPanel.actions.collapsePanel': 'パネルを折りたたむ',
|
||||
|
||||
Reference in New Issue
Block a user