mdn / mdn/webextensions-examples

Update execCommand use in context-menu-copy-link-with-types

Open
#543 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

effort: medium enhancement idle on hold p2
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.