mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
selection-to-clipboard
What it does
This extension includes:
- a content script, "content-script.js", that is injected into all pages
The content script listens for text selections in the page it's attached to and copies the text to the clipboard on mouse-up.
What it shows
- how to inject content scripts declaratively using manifest.json
- how to write to the clipboard
Note
- If the
copySelectionfunction was in a browser eventclipboardWritepermissions would be required e.g.
"permissions": ["clipboardWrite"]