diff --git a/src/background/background.js b/src/background/background.js index 9083e1b..4f99768 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -575,6 +575,14 @@ async function createMenus() { }, () => { }); } +browser.commands.onCommand.addListener(function (command) { + if (command == "download_tab_as_markdown") { + const tab = browser.tabs.getCurrent() + const info = { menuItemId: "download-markdown-all" }; + downloadMarkdownFromContext(info, tab); + } +}); + // click handler for the context menus browser.contextMenus.onClicked.addListener(function (info, tab) { // one of the copy to clipboard commands diff --git a/src/manifest.json b/src/manifest.json index 6f0dd6e..d211e0b 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -52,11 +52,17 @@ "suggested_key": { "default": "Alt+Shift+M" } - } + }, + "download_tab_as_markdown": { + "suggested_key": { + "default": "Ctrl+Shift+M" + }, + "description": "Save current tab as Markdown" + } }, "browser_specific_settings": { "gecko": { "id": "{1c5e4c6f-5530-49a3-b216-31ce7d744db0}" } } -} \ No newline at end of file +}