-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restore copy items in page context menu
- 2/3 of #294 - the same code is run from browserAction and context menu items - there is no API to programmatically display/hide menu items, so we just remove/recreate menu items for now. This needs to be refactored in future after APIs such as https://bugzilla.mozilla.org/show_bug.cgi?id=1397249 land in browsers. - works under Firefox and Chrome, which is not an easy feat: Firefox does not allow for text selection and copying within background page. This was worked around by injecting content script into the current tab and executing copying logic there. References: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard https://github.com/mdn/webextensions-examples/tree/master/context-menu-copy-link-with-types
- Loading branch information
Showing
3 changed files
with
121 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters