Skip to content

Commit

Permalink
Add direct keyboard shortcut for Download tab as Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
quintrino committed Apr 14, 2021
1 parent 46280fe commit 80dd0b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}
}
}

0 comments on commit 80dd0b8

Please sign in to comment.