feat(desktop): embed read-only browser workspace#6
Merged
gu87 merged 4 commits intoJun 7, 2026
Conversation
- Add BrowserSessionManager (electron/browser-session.cjs) with: WebContentsView lifecycle, isolated persist:hermes-browser session, dangerous scheme blocking (file:, javascript:, data:, etc.), popup deny (external http/https → shell.openExternal), download prevention, sensitive permission deny - Add browser IPC handlers in main.cjs: - mount / unmount / set-bounds (WebContentsView lifecycle) - get-state (URL, title, canGoBack, canGoForward, isLoading) - navigate / reload / stop / go-back / go-forward with source:'user' guard - is-available (HERMES_DESKTOP_DISABLE_BROWSER env guard) - page event forwarding (title, favicon, navigate, loading) - before-quit cleanup - Add browser API bridge in preload.cjs - Rewrite BrowserWorkspace UI with URL bar, nav buttons, ResizeObserver-based WebContentsView mount container, status bar - Add TypeScript types for browser lifecycle, state, and navigation - No extraction (screenshot/DOM/selected text) handlers - No Copy to Chat UI Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add get-dom-summary handler (executeJavaScript for title, meta description, h1-h3 headings, body.innerText preview) - Add get-screenshot handler (webContents.capturePage() → dataURL) - Add get-selected-text handler (executeJavaScript for window.getSelection()) - All executeJavaScript calls are static, read-only DOM access only - No preload bridge or DOM manipulation injected into embedded pages Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a renderer-only action that captures the current browser URL, title, DOM summary, and screenshot, then copies the formatted context to the clipboard. This does not insert into the chat composer or send a message; composer insertion remains a future step.
6bfb211 to
7700475
Compare
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.
Summary
Adds an embedded Browser Workspace to the Electron desktop client.
This upgrades the existing
/browserlauncher placeholder into a real WebContentsView-backed browser surface with user-driven navigation, page state tracking, and read-only context extraction.What Changed
/browser.Safety Boundary
source: "user".executeJavaScriptis static and read-only only.Validation
npm run type-check --workspace apps/desktop— PASSnpm run build --workspace apps/desktop— PASSnpm run test:desktop:platforms --workspace apps/desktop— 79 PASSScope
🤖 Generated with Claude Code