You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native V8 runtime currently exposes ClipboardItem and navigator.clipboard.write(items), but writes are fire-and-forget JSON host requests and clipboard reads are absent. Code OSS's browser clipboard service calls writeText, readText, write, and read; copy can fall through to an unsupported legacy execCommand, and paste/image operations cannot reach the operating-system clipboard.
Proposed contract
Add a versioned native clipboard request/completion ABI with request ID, operation, MIME type, immutable bytes, and explicit completed/cancelled/failed status.
Implement Promise-based navigator.clipboard.writeText, readText, write, and read, plus ClipboardItem, on top of that ABI.
Dispatch bubbling, cancelable browser copy, cut, and paste events for non-prevented native Ctrl/Command-C/X/V shortcuts. Expose bounded clipboardData text/plain and text/html representations and preserve the initiating target across async paste reads.
Preserve the existing host-request write path only as a compatibility fallback for older hosts; report its partial capability accurately.
Support text/plain, text/html, and bounded image bytes initially. Reject unsupported MIME types explicitly.
Require a trusted top-level document and recent user activation for reads. Bind requests to the originating realm/navigation generation and cancel them on navigation or engine teardown.
Bound pending requests, item count, per-item bytes, and total bytes. Do not serialize binary payloads through base64 JSON in the new ABI.
Acceptance criteria
Web IDL/API shape, brand checks, Promise behavior, MIME handling, and DOMException names match the supported subset.
Native Ctrl/Command-C/X/V dispatches browser-compatible clipboard events; exact text/HTML host bytes, paste target lifetime, event cancellation, and input-queue ordering are covered.
A 10,000-operation small-text round-trip gate and maximum-payload gate publish elapsed time and retained-memory/request-pool high-water metrics; no timing sleeps determine correctness.
Existing Avalonia/Uno hosts either implement the ABI or expose an explicit unsupported result without regression.
Hosted and packaged Windows, macOS, and Linux jobs plus cross-RID/consumer checks pass.
The Code OSS package passes real native copy/paste text and image qualification through AppScene with no VS Code source change.
This belongs in WebScene because it is a standard browser API and shared native host ABI, independent of Electron and of any one application.
AppScene coordination epic: SceneTech/AppScene#66
Problem
The native V8 runtime currently exposes
ClipboardItemandnavigator.clipboard.write(items), but writes are fire-and-forget JSON host requests and clipboard reads are absent. Code OSS's browser clipboard service callswriteText,readText,write, andread; copy can fall through to an unsupported legacyexecCommand, and paste/image operations cannot reach the operating-system clipboard.Proposed contract
navigator.clipboard.writeText,readText,write, andread, plusClipboardItem, on top of that ABI.copy,cut, andpasteevents for non-prevented native Ctrl/Command-C/X/V shortcuts. Expose boundedclipboardDatatext/plain and text/html representations and preserve the initiating target across async paste reads.text/plain,text/html, and bounded image bytes initially. Reject unsupported MIME types explicitly.Acceptance criteria
This belongs in WebScene because it is a standard browser API and shared native host ABI, independent of Electron and of any one application.