v132 · Rich Copy Formatter
Rich Copy Formatter
Chrome 132 lets ClipboardItem accept a string or Promise<string> directly — no need to wrap everything in a Blob. Edit the rich text below, then copy it with both HTML and plain-text representations on the clipboard simultaneously. Paste into Word, Gmail, or a terminal to see the format switch.
Rich text editor
HTML preview (what goes on clipboard)
Ready — edit the content above, then copy.
Before and after Chrome 132
Before (Blob required)
// Had to wrap everything in a Blob
async function copyWithBlob(html, text) {
const item = new ClipboardItem({
'text/html': new Blob([html], {
type: 'text/html'
}),
'text/plain': new Blob([text], {
type: 'text/plain'
}),
});
await navigator.clipboard.write([item]);
}
After Chrome 132 (string / Promise<string>)
// Strings accepted directly — no Blob needed
async function copyWithString(html, text) {
const item = new ClipboardItem({
'text/html': html, // plain string
'text/plain': text, // plain string
});
await navigator.clipboard.write([item]);
}
// Also works with Promise<string>:
const item = new ClipboardItem({
'text/html': fetchRemoteHtml(), // Promise
'text/plain': 'plain fallback',
});