mdn / mdn/webextensions-examples
Update execCommand use in context-menu-copy-link-with-types
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 4.5k
- Forks
- 2.6k
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 3
Description
context-menu-copy-link-with-types uses a content script because when the example was written execCommand didn't work in background pages; now they do so the example should be updated to call execCommand from the background page instead of using a content script.
Note, before updating check whether Clipboard.write() is available in Firefox, as this would be the preferred method given that execCommand is deprecated.
MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write
MDN URL: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the context-menu-copy-link-with-types example and inspect how its content script and background page currently handle copying. Check the linked Clipboard.write() documentation and Firefox availability before choosing the implementation. Done means the example no longer relies on the content script for copying and uses the supported background-page approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100