demo · v140

Clipboard Watcher

Hit start, then copy something from anywhere on your system. The watcher logs every clipboardchange event — even from copies made outside the page.

Idle

Event log:

No events yet.

navigator.clipboard.addEventListener("clipboardchange", async () => {
  const items = await navigator.clipboard.read();
  for (const item of items) {
    console.log("clipboard now contains:", item.types);
  }
});

see also