clipboard-inserter icon indicating copy to clipboard operation
clipboard-inserter copied to clipboard

Patch to fix deprecated execCommand

Open Aquafina-water-bottle opened this issue 2 years ago • 0 comments

execCommand seems to be deprecated and is no longer working on the latest Firefox release. This patch fixes it by using the newer clipboard API instead.

Notes:

  • I haven't tested this out on any browser other than Firefox, but the caniuse page shows that it works the latest versions of basically all browsers outside of IE11, so I assume it works.
  • With the newer API, I don't think the paste-target div is actually needed anymore, but I kept it here just in case.
  • I'm leaving the version bumping (in manifest.json) up to you.
  • Fixes #14

EDIT: For people who want an updated/rewritten alternative that works on Firefox, see lap-clipboard-inserter.

Aquafina-water-bottle avatar Nov 17 '22 23:11 Aquafina-water-bottle