diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 20003ec..bf1f220 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -11,12 +11,20 @@ "message": "Browser extension to bookmark fragments of audio files", "description": "The description of the application" }, + "copySelectionContextMenuItemForFragment": { + "message": "Copy link to selected fragment", + "description": "The context menu item to copy a selected audio fragment" + }, + "copySelectionContextMenuItemForSingleMoment": { + "message": "Copy link to selected moment", + "description": "The context menu item to copy a selected moment" + }, "bookmarkSelectionContextMenuItemForFragment": { "message": "Bookmark selected fragment", - "description": "The entry in the context ('right-click') menu when selecting an audio fragment" + "description": "The context menu item to bookmark a selected audio fragment" }, "bookmarkSelectionContextMenuItemForSingleMoment": { "message": "Bookmark selected moment", - "description": "The entry in the context ('right-click') menu when selecting a single moment" + "description": "The context menu item to bookmark a selected single moment" } } diff --git a/app/assets/main.css b/app/assets/main.css index 4215132..463478d 100644 --- a/app/assets/main.css +++ b/app/assets/main.css @@ -99,6 +99,8 @@ input#volume:focus { } .context-menu button { + width: 100%; + text-align: unset; background: none; border: none; font-size: 1em; diff --git a/app/create-bookmarks/contentscript.js b/app/create-bookmarks/contentscript.js index f765a81..fffd297 100644 --- a/app/create-bookmarks/contentscript.js +++ b/app/create-bookmarks/contentscript.js @@ -61,6 +61,15 @@ export default async function init(playlist) { } const menuItems = [ + { + title: browser.i18n.getMessage(end !== undefined + ? 'copySelectionContextMenuItemForFragment' + : 'copySelectionContextMenuItemForSingleMoment' + ), + async action() { + await navigator.clipboard.writeText(preciseUrl()); + }, + }, { title: browser.i18n.getMessage(end !== undefined ? 'bookmarkSelectionContextMenuItemForFragment' diff --git a/app/manifest.json b/app/manifest.json index d11f6fe..d5782c7 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -10,6 +10,7 @@ }, "permissions": [ "", + "clipboardWrite", "bookmarks", "tabs", "webRequest"