v149 · Clipboard · Eager vs. Lazy
Eager vs. Lazy Comparison
Before Chrome 149, clipboard.read() fetched all format data immediately. After Chrome 149, read() returns only the type list — data is fetched lazily per format. This comparison shows the timeline difference and the code change required.
These timelines are illustrative based on a typical clipboard containing text/plain, text/html, and image/png. Actual times depend on clipboard content size and OS.
timeline comparison
Before Chrome 149 — eager
App needs only text/plain:
Total before app gets text: ~82 ms
Chrome 149+ — lazy
App needs only text/plain:
Total before app gets text: ~20 ms
Eager (all formats)
Lazy fetch
Already in memory
code change
// BEFORE Chrome 149 — identical code, but eager under the hood
const items = await navigator.clipboard.read();
// ^ All format data fetched here (slow for large clipboards)
for (const item of items) {
const blob = await item.getType('text/plain');
// ^ Just returns the already-loaded blob — fast, but wasted work above
}
// AFTER Chrome 149 — same code, lazy under the hood
const items = await navigator.clipboard.read();
// ^ Only type list fetched — fast even with large clipboard
for (const item of items) {
// Only items that call getType() trigger an OS clipboard read:
if (item.types.includes('text/plain')) {
const blob = await item.getType('text/plain');
// ^ Fetches only text/plain from the OS — skips image/png, text/html
}
}
// No code change required — Chrome 149 makes this automatically lazy
what sites benefit most
- Rich text editors that only need
text/htmlbut the clipboard has a large image - Search boxes that paste plain text and discard the HTML/image formats
- Format detectors that check
item.typesto choose a paste handler — now free to inspect without reading data - Multi-clipboard-item UIs that list available items before the user selects one
see also
- Lazy Read Demo — step-through interactive demo
- ChromeStatus entry
- MDN — Clipboard.read()
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗