Skip to content

feat(browser): send pages to OpenClaw from the Chrome extension - #111158

Merged
steipete merged 6 commits into
mainfrom
claude/openclaw-chrome-extension-d57193
Jul 19, 2026
Merged

steipete merged 6 commits into
mainfrom
claude/openclaw-chrome-extension-d57193

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

There was no way to hand the page you are looking at to your OpenClaw agent. The community tool Nateliason/send-to-openclaw proved the demand, but it needs a separate Chrome extension plus a local Express webhook server that shells out to the CLI — an entire second install and token surface that exists only because a vanilla extension has no authenticated path to the Gateway. Our extension already owns one.

Why This Change Was Made

Fold "send this page to my agent" into the official OpenClaw Chrome extension as a third feature next to tab control and the tab copilot, riding the existing paired relay WebSocket:

  • Extension: toolbar-popup send button with an optional note, a page/selection context-menu item, and an Alt+Shift+S command. Capture is selection-first, with a readability-style heuristic, X/Twitter thread extraction, and Google Docs plain-text export fetched inside the tab so the user's cookies apply (no Google API setup). New pageShare extension→relay message with correlated pageShareResult acks.
  • Gateway: the relay bridge validates payloads (size caps included) and hands them to a page-share sink registered only by the browser plugin's Gateway service — plugin services never start on node hosts, so node-hosted relays return a clear "not supported" error instead of black-holing events in a process with no agent loop. Delivery matches POST /hooks/wake semantics exactly: system event on the main session + immediate heartbeat.
  • Safety: page text is wrapped with wrapExternalContent(source: "browser"); the user's typed note stays outside the wrapper as their own instruction. System-tag sanitization applies at the queue boundary as usual.
  • SDK: one additive export (resolveMainSessionKeyFromConfig via openclaw/plugin-sdk/system-event-runtime) with the surface budget bumped +1/+1 and the ledger comment updated.

Capture heuristics adapted from Nat Eliason's MIT-licensed send-to-openclaw (credit: @Nateliason).

User Impact

Pair the extension once, then send any page, Google Doc, X thread, or text selection to your main session in one click/keystroke — no extra server, port, token, or config. The tab does not need to be in the OpenClaw tab group; a share is one-shot and grants no ongoing access. Docs: new "Send a page to OpenClaw" section in docs/tools/chrome-extension.md.

Evidence

  • Focused suites (local, worktree lock scope): node scripts/run-vitest.mjs extensions/browser/src/browser/extension-relay/ extensions/browser/chrome-extension/modules/page-share-core.test.ts extensions/browser/src/plugin-service.test.ts extensions/browser/chrome-extension/background.test.ts → 9 files, 54 tests passed.
  • pnpm plugin-sdk:surface:check green (8158 exports / 4540 callable, +1/+1 documented).
  • Live end-to-end proof against a scratch Gateway (isolated OPENCLAW_STATE_DIR, port 19477): real Chromium + unpacked extension paired over the direct Gateway route ([browser/extension-relay-gateway] extension connected over gateway for profile "chrome"), sent https://example.com with a note → extension received {"ok":true}, which the bridge only sends after deliverPageShare resolved (system event enqueued + immediate heartbeat requested in the Gateway process). Driver used a scoped test host_permissions copy because scripted messages are not user gestures; real popup/menu/shortcut clicks are gestures, so the shipped manifest needs only activeTab.
  • Autoreview (Codex, gpt-5.6-sol, xhigh): three review cycles, all findings fixed — (1) page-controlled title/URL moved inside the untrusted-content boundary, (2) selection-first enforced for Google Docs instead of always exporting the full document, (3) context-menu shares rebuilt as click-time snapshots (no recapture) so navigation races and iframe selections cannot mislabel or lose content, (4) the Docs selection probe reduced to a deterministic main-frame read with the child-frame tradeoff named in a code comment. Final run: autoreview clean: no accepted/actionable findings, "patch is correct (0.96)".
  • Scanner note: the helper's secret scan rejects any diff touching the pre-existing ROTATED_TOKEN = "b".repeat(64) fixture in relay-lifecycle.test.ts, so that file's one-line assertion update (onPageShare: expect.any(Function)) landed as its own commit outside the helper bundle and was reviewed by hand.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a8b0569f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +54
content: truncateShareText(normalizedContent, PAGE_SHARE_MAX_CONTENT_CHARS),
...(normalizedSelection
? { selection: truncateShareText(normalizedSelection, PAGE_SHARE_MAX_CONTENT_CHARS) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Omit full-page content when a selection exists

When a normal page has selected text, capturePageContent returns both the selection and the extracted full page, and this builder preserves both fields; sendPageShareRequest then serializes the entire payload to the Gateway. Although deliverPageShare later ignores content, the rest of the page has already crossed the relay, violating the selection-only privacy promise in docs/tools/chrome-extension.md:148-154. Clear or omit content whenever normalizedSelection is nonempty.

Useful? React with 👍 / 👎.

@steipete steipete closed this Jul 19, 2026
@steipete steipete reopened this Jul 19, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 4:04 AM ET / 08:04 UTC.

Summary
Adds one-click Chrome-extension sharing of selected or extracted page content to the main OpenClaw session through the paired extension relay, including popup, context-menu, shortcut, Gateway delivery, docs, and a small plugin-SDK export.

PR surface: Source +667, Tests +339, Docs +25, Generated 0, Other +2. Total +1033 across 24 files.

Reproducibility: yes. from source: focus a child iframe, select text in it, then use the popup or Alt+Shift+S path; the final implementation’s documented tradeoff falls back to top-level extraction rather than preserving that selection.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/browser/src/browser/extension-relay/relay-bridge.test.ts, serialized state: extensions/browser/src/browser/extension-relay/relay-protocol.test.ts, vector/embedding metadata: extensions/browser/src/browser/extension-relay/page-share.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦐 gold shrimp
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Implement a selection-safe child-frame path or fail-closed response.
  • [P1] Add redacted live proof covering popup or shortcut sharing with an iframe-owned selection.
  • Update the PR body after adding proof so ClawSweeper can re-review.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body describes a credible real Chromium-to-Gateway run, but it does not show the unresolved iframe-selection behavior or the normal popup/shortcut path after the final fixes; add redacted terminal output or a recording demonstrating the selection-safe result. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Popup and keyboard-shortcut shares can send top-level page text when the user's active selection is inside a child frame, expanding the disclosed content beyond the explicit selection.
  • [P1] The feature adds browser-to-agent ingress and a plugin-SDK export, so its privacy semantics and public SDK surface need explicit owner approval before merge.

Maintainer options:

  1. Make child-frame selections fail closed (recommended)
    Keep selection-first behavior across popup, shortcut, and context-menu paths by capturing the focused frame or returning a clear no-share error.
  2. Accept the documented limitation
    Land the current fallback only after an owner explicitly accepts that a child-frame selection can cause the surrounding page to be shared.

Next step before merge

  • [P1] The remaining blocker is a browser-ingress privacy boundary and the PR carries the protected maintainer label, so an owner must choose the fail-closed behavior before any repair or merge path.

Maintainer decision needed

  • Question: Should popup and shortcut page sharing fail closed for a focused child-frame selection until that selection can be captured, rather than sending the enclosing top-level page?
  • Rationale: This is a user-data disclosure boundary, not a routine implementation detail: accepting full-page fallback changes the product’s explicit-share and selection-first promise.
  • Likely owner: steipete — The available history ties this contributor directly to the browser page-share design and the stated child-frame tradeoff.
  • Options:
    • Require selection-safe fallback (recommended): Reject the share when a focused child frame may own the selection, or capture that frame’s selection, before allowing merge.
    • Accept full-page fallback: Document that popup and shortcut can share surrounding page content for child-frame selections and explicitly accept that privacy tradeoff.

Security
Needs attention: The patch preserves an external-content wrapper, but its child-frame selection fallback can broaden the user-selected data sent to the agent.

Review findings

  • [P1] Fail closed for child-frame selections — extensions/browser/chrome-extension/modules/page-share-core.js:101-121
Review details

Best possible solution:

Make every entry point selection-safe: capture the focused frame’s selection where possible, otherwise stop with a clear instruction to use the selection context menu rather than falling back to full-page extraction.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: focus a child iframe, select text in it, then use the popup or Alt+Shift+S path; the final implementation’s documented tradeoff falls back to top-level extraction rather than preserving that selection.

Is this the best way to solve the issue?

No. The relay and external-content wrapper are appropriate, but accepting a full-page fallback for an iframe-owned selection is not the narrowest safe implementation; capture the focused frame or fail closed.

Full review comments:

  • [P1] Fail closed for child-frame selections — extensions/browser/chrome-extension/modules/page-share-core.js:101-121
    When text is selected in a child frame, the popup and shortcut path reads only the main-frame selection and then sends extracted top-level content. The final commit explicitly keeps this fallback, but it violates the documented selection-first share contract and can disclose content the user did not select. Capture the focused frame’s selection or return a clear error instructing the user to use the selection context menu.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a8b7290f346c.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a meaningful but bounded browser-ingress privacy and UX regression in a newly proposed feature rather than an established production outage.
  • merge-risk: 🚨 compatibility: The new browser and plugin-SDK behavior establishes an externally visible sharing contract whose semantics must remain consistent across entry points.
  • merge-risk: 🚨 security-boundary: The child-frame fallback can send unselected page text across the browser-to-agent ingress boundary.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body describes a credible real Chromium-to-Gateway run, but it does not show the unresolved iframe-selection behavior or the normal popup/shortcut path after the final fixes; add redacted terminal output or a recording demonstrating the selection-safe result. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +667, Tests +339, Docs +25, Generated 0, Other +2. Total +1033 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 13 677 10 +667
Tests 7 340 1 +339
Docs 2 25 0 +25
Config 0 0 0 0
Generated 1 1 1 0
Other 1 4 2 +2
Total 24 1047 14 +1033

Security concerns:

  • [medium] Child-frame selection can disclose top-level page text — extensions/browser/chrome-extension/modules/page-share-core.js:101
    A focused iframe selection is not detected by popup or shortcut capture, so the feature may transmit top-level extracted content instead of the user’s explicit selection.
    Confidence: 0.94

What I checked:

Likely related people:

  • steipete: Authored the current page-sharing implementation and the follow-up commit that documents the child-frame-selection tradeoff; stronger current-main ownership provenance was unavailable from the read-only inspection environment. (role: recent browser-plugin contributor; confidence: low; commits: 768f90d846bb, f57f21dec313, 0278c7d5352f; files: extensions/browser/chrome-extension/modules/page-share-core.js, extensions/browser/src/browser/extension-relay/page-share.ts, extensions/browser/src/plugin-service.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-19T03:59:41.393Z sha 3a8b056 :: found issues before merge. :: [P1] Omit full-page content when a selection exists
  • reviewed 2026-07-19T07:12:54.151Z sha 85b7253 :: needs real behavior proof before merge. :: [P1] Initialize page sharing from the lazy service wrapper
  • reviewed 2026-07-19T07:56:39.899Z sha 20101e398757860d1caff552b2f55c227695cbfe :: needs real behavior proof before merge. :: [P1] Initialize page sharing from the lazy service wrapper | [P1] Fail closed when a child frame owns the selection | [P2] Handle account-qualified Google Docs URLs | [P2] Reply on the socket that submitted the page share

@steipete steipete self-assigned this Jul 19, 2026
@steipete
steipete force-pushed the claude/openclaw-chrome-extension-d57193 branch from 3a8b056 to 85b7253 Compare July 19, 2026 06:58
@steipete steipete closed this Jul 19, 2026
@steipete steipete reopened this Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85b725314e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +36
const pageShare = await import("./browser/extension-relay/page-share.js");
// Plugin services start only in the Gateway process. The sink marks this
// process as able to deliver page shares to the main session.
pageShare.setPageShareSink(pageShare.createGatewayPageShareSink());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Initialize page sharing from the lazy service wrapper

When OPENCLAW_EAGER_BROWSER_CONTROL_SERVER is unset (the default), createLazyBrowserPluginService.start returns at extensions/browser/plugin-registration.ts:192-195 before loading this service, so this sink registration never runs. The direct Gateway route and browser requests can still lazily start the control service and create a relay whose onPageShare calls deliverPageShare, but pageShareSink remains null; consequently every page share in the default configuration responds with PAGE_SHARE_GATEWAY_REQUIRED_ERROR. Register the sink lifecycle in the default wrapper/Gateway path rather than only in the eager-loaded service.

Useful? React with 👍 / 👎.

Comment on lines +576 to +579
async function sendPageToOpenClaw(tabId, note) {
await ensureRelayReady();
const tab = await chrome.tabs.get(tabId);
const capture = await capturePageShare(tab);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Capture the page before waiting for relay reconnection

When a paired relay is disconnected, this wait can last three seconds before chrome.tabs.get and content capture occur. If the user invokes the page context-menu action, shortcut, or popup send and then navigates, a same-origin navigation sends the new document instead of the page they explicitly shared, while a cross-origin navigation can revoke activeTab and make the share fail. Capture the user-action-time document before reconnecting, as the selection context-menu path already does.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(browser): send pages to OpenClaw from the Chrome extension This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc1fe95239

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (parsed.hostname !== "docs.google.com") {
return null;
}
return /^\/document\/d\/([^/]+)/u.exec(parsed.pathname)?.[1] ?? null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle account-qualified Google Docs URLs

When Google account routing produces a URL such as https://docs.google.com/document/u/1/d/<id>/edit, this matcher returns null because it only accepts /document/d/.... capturePageShare then skips the text export and applies generic DOM extraction to the Docs editor, which can return interface or incomplete canvas content instead of the document promised by this feature. Accept the optional /u/<account-index> path segment before /d/.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the claude/openclaw-chrome-extension-d57193 branch from cc1fe95 to 20101e3 Compare July 19, 2026 07:47
@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20101e3987

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


/** Self-contained because chrome.scripting serializes this function source. */
function capturePageContent() {
const selection = window.getSelection()?.toString().trim() ?? "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fail closed when a child frame owns the selection

When a user highlights text inside an iframe and invokes the toolbar or Alt+Shift+S instead of the selection context menu, this reads only the top-frame selection, so it returns empty; extraction subsequently removes the iframe and silently sends the surrounding top-level page. This violates the selection-first privacy behavior documented in docs/tools/chrome-extension.md:148-154. This is separate from the already-flagged detected-selection issue because here the selection is never detected; detect a focused child frame and capture it or refuse the share rather than falling back to the full page.

Useful? React with 👍 / 👎.

Comment on lines +273 to +274
await this.onPageShare(payload);
this.sendPageShareResult({ requestId, ok: true });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return page-share results to the originating socket

If the MV3 worker reconnects while onPageShare is awaiting delivery, this acknowledgment is sent through the mutable current this.extension, not the socket that submitted the request. A restarted worker resets nextPageShareRequestId to 1, so a delayed success or error for the previous worker's request 1 can resolve or reject the new worker's unrelated request 1, producing a false result. Bind each response to its originating socket or connection generation.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Jul 19, 2026
steipete and others added 6 commits July 19, 2026 00:59
One-click page share in the OpenClaw Chrome extension: toolbar popup with an
optional note, page/selection context menu, and Alt+Shift+S. Capture is
selection-first with a readability heuristic, X/Twitter thread extraction, and
Google Docs plain-text export via the user's session cookies. Payloads ride the
existing paired relay WebSocket as a new pageShare message; the gateway-only
page-share sink wraps page text in the external-content safety boundary, then
enqueues a main-session system event and requests an immediate heartbeat
(hooks/wake semantics). Node-hosted relays report a clear unsupported error.

Capture heuristics adapted from Nat Eliason's MIT-licensed send-to-openclaw.

Co-authored-by: Codex <[email protected]>
…oundary

Review findings: move title/URL inside wrapExternalContent (a hostile <title>
must not become trusted header text), prefer the user's selection over the
full Google Docs export, and pass the context-menu selectionText through so
iframe selections and selections cleared during relay reconnect still win.
Selection shares from the context menu now send the click snapshot directly
(no recapture), so navigations during relay reconnect cannot mislabel the
source and iframe selections are preserved. The Google Docs selection probe
scans all accessible frames before falling back to the full-document export.
All-frame injection rejects wholesale when one frame is inaccessible and
returns child frames in nondeterministic order, so the probe now reads the
main frame only. Child-frame selections still share correctly through the
context menu's click-time selectionText; toolbar/shortcut entry sends the
full page for that case (named tradeoff in the code comment).
@steipete
steipete force-pushed the claude/openclaw-chrome-extension-d57193 branch from 20101e3 to 0278c7d Compare July 19, 2026 08:00
@steipete
steipete merged commit 4efcea1 into main Jul 19, 2026
115 checks passed
@steipete
steipete deleted the claude/openclaw-chrome-extension-d57193 branch July 19, 2026 08:07
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 19, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 20, 2026
…claw#111158)

* feat(browser): send pages to the main session from the Chrome extension

One-click page share in the OpenClaw Chrome extension: toolbar popup with an
optional note, page/selection context menu, and Alt+Shift+S. Capture is
selection-first with a readability heuristic, X/Twitter thread extraction, and
Google Docs plain-text export via the user's session cookies. Payloads ride the
existing paired relay WebSocket as a new pageShare message; the gateway-only
page-share sink wraps page text in the external-content safety boundary, then
enqueues a main-session system event and requests an immediate heartbeat
(hooks/wake semantics). Node-hosted relays report a clear unsupported error.

Capture heuristics adapted from Nat Eliason's MIT-licensed send-to-openclaw.

Co-authored-by: Codex <[email protected]>

* fix(browser): keep page-controlled metadata inside the share safety boundary

Review findings: move title/URL inside wrapExternalContent (a hostile <title>
must not become trusted header text), prefer the user's selection over the
full Google Docs export, and pass the context-menu selectionText through so
iframe selections and selections cleared during relay reconnect still win.

* fix(browser): bind context-menu shares to the click-time document

Selection shares from the context menu now send the click snapshot directly
(no recapture), so navigations during relay reconnect cannot mislabel the
source and iframe selections are preserved. The Google Docs selection probe
scans all accessible frames before falling back to the full-document export.

* test(browser): expect the page-share handler in relay server args

* fix(browser): probe only the main frame for Google Docs selections

All-frame injection rejects wholesale when one frame is inaccessible and
returns child frames in nondeterministic order, so the probe now reads the
main frame only. Child-frame selections still share correctly through the
context menu's click-time selectionText; toolbar/shortcut entry sends the
full page for that case (named tradeoff in the code comment).

* fix(browser): satisfy page-share CI gates

---------

Co-authored-by: Codex <[email protected]>
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…claw#111158)

* feat(browser): send pages to the main session from the Chrome extension

One-click page share in the OpenClaw Chrome extension: toolbar popup with an
optional note, page/selection context menu, and Alt+Shift+S. Capture is
selection-first with a readability heuristic, X/Twitter thread extraction, and
Google Docs plain-text export via the user's session cookies. Payloads ride the
existing paired relay WebSocket as a new pageShare message; the gateway-only
page-share sink wraps page text in the external-content safety boundary, then
enqueues a main-session system event and requests an immediate heartbeat
(hooks/wake semantics). Node-hosted relays report a clear unsupported error.

Capture heuristics adapted from Nat Eliason's MIT-licensed send-to-openclaw.

Co-authored-by: Codex <[email protected]>

* fix(browser): keep page-controlled metadata inside the share safety boundary

Review findings: move title/URL inside wrapExternalContent (a hostile <title>
must not become trusted header text), prefer the user's selection over the
full Google Docs export, and pass the context-menu selectionText through so
iframe selections and selections cleared during relay reconnect still win.

* fix(browser): bind context-menu shares to the click-time document

Selection shares from the context menu now send the click snapshot directly
(no recapture), so navigations during relay reconnect cannot mislabel the
source and iframe selections are preserved. The Google Docs selection probe
scans all accessible frames before falling back to the full-document export.

* test(browser): expect the page-share handler in relay server args

* fix(browser): probe only the main frame for Google Docs selections

All-frame injection rejects wholesale when one frame is inaccessible and
returns child frames in nondeterministic order, so the probe now reads the
main frame only. Child-frame selections still share correctly through the
context menu's click-time selectionText; toolbar/shortcut entry sends the
full page for that case (named tradeoff in the code comment).

* fix(browser): satisfy page-share CI gates

---------

Co-authored-by: Codex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant