Skip to content

Commit

Permalink
Merge pull request #74 from quintrino/add_keyboard_shortcut_for_downl…
Browse files Browse the repository at this point in the history
…oad_page

Add direct keyboard shortcut for Download tab as Markdown
  • Loading branch information
deathau authored Jul 7, 2021
2 parents 1c9dc07 + 80dd0b8 commit 63e2785
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 63e2785

Please sign in to comment.