The clipboardWrite permission allows an extension to write content to the system clipboard via navigator.clipboard.writeText() / navigator.clipboard.write() from contexts that don't have a fresh user activation.
How it works
In Manifest V3, the asynchronous Clipboard API (navigator.clipboard) is the standard way to write the clipboard. With a transient user activation (e.g., a click handler in a popup or content script) writeText works without clipboardWrite. The permission is required when writing happens without a user gesture — typically from an offscreen document driven by a service worker.
When to use it
Use this for any extension that needs to place data on the user's clipboard.
Examples:
- A "copy link" button in a custom UI.
- An extension that generates a password and copies it for the user.
- A tool that copies a formatted citation to the clipboard.
Manifest Declaration
{
"name": "My Clipboard Extension",
"version": "1.0",
"manifest_version": 3,
"permissions": [
"clipboardWrite"
]
}Note: In Manifest V3, calls to navigator.clipboard.writeText() made directly inside a user-gesture handler (e.g., an onclick listener in a popup) succeed without this permission. Declare clipboardWrite when the write happens without a user activation — e.g., from an alarm handler, message listener, or other service-worker-driven flow that bridges through an offscreen document.
Security & Privacy
Why is it risky?
This permission allows an extension to change the contents of your clipboard (what you paste with Ctrl+V or Cmd+V). This can be used for a sneaky attack called "clipboard hijacking."
For example, imagine you copy a friend's cryptocurrency wallet address to send them money. A malicious extension could instantly replace that address in your clipboard with a hacker's address. When you paste it, you would unknowingly send your money to the wrong person. Be cautious with extensions that want to write to your clipboard without you telling them to.
API Usage Example (Modern V3 Approach)
This example copies text to the clipboard from a service worker when the user clicks a context menu item. It does not require any permissions in the manifest.
// background.js
// Requires the "contextMenus" permission
chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({
id: "copy-page-url",
title: "Copy Page URL",
contexts: ["page"]
});
});
chrome.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "copy-page-url" && tab.url) {
copyTextToClipboard(tab.url);
}
});
async function copyTextToClipboard(text) {
try {
await navigator.clipboard.writeText(text);
console.log('URL copied to clipboard!');
} catch (err) {
console.error('Failed to copy text: ', err);
}
}Extensions with the clipboardWrite permission
Here are some popular browser extensions that use the "clipboardWrite" permission. To explore more, try our Advanced search.