v140 · miscellaneous

Clipboardchange event

The "clipboardchange" event fires whenever the system clipboard contents are changed either by a web app or any other system application. This allows web-apps like remote desktop clients to keep their clipboards synchronized with the system clipboard. It provides an efficient alternative to polling the clipboard(using Javascript) for changes.

concepts

  1. Clipboard Watcher

    An event that fires when the system clipboard changes — from any source. Pair with the existing read APIs to react to copy events from other apps.

  2. Remote Desktop Sync

    The chromestatus motivation: a remote desktop client mirroring the local clipboard to a VM. Side-by-side event-driven vs. poll-on-focus, with a counter showing the wasted reads polling produces.

  3. Poll vs Event

    Two clipboards in a footrace. Left column polls every 500 ms; right column waits for clipboardchange. Real-time tally of wasted reads, with visual bars showing the gap.

  4. Format Watcher

    The clipboard carries several MIME types in parallel — plaintext, HTML, image. Watch the type chips flip live as you copy a quote, a URL, or a screenshot.

  5. Paste Prompt

    The Notion / Linear contextual paste hint pattern, made first-class. The editor pops a "Paste as link" / "Paste as image" toast the moment you copy something useful.

  6. Cross-tab clipboard coordination

    The clipboardchange event only fires in the focused tab. This demo relays it to a simulated second tab via BroadcastChannel — showing the remote desktop / collaborative editor pattern: Tab A reads the clipboard on every event, Tab B receives the forwarded content with measured latency.

why it shipped

Today, a web-app can monitor the system clipboard by polling and reading the clipboard through async clipboard API at regular intervals. For example, web based remote desktop clients like Chrome Remote desktop may read the clipboard contents for changes on every page focus event which is inefficient. Some Github links also suggests polling of clipboard being performed in Electron JS apps like (https://gist.github.com/LewdEwe-ErikWallace/d6e36f899a77a4f05e46388c254d014f).

references