feat(extension): add a keyboard shortcut to save page #1532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new keyboard shortcut (
Ctrl/Cmd+Shift+E
by default --Ctrl+Shift+K
was not working for some reason) that allows users to save the current page to Karakeep without needing to use the context menu or click the extension icon (which is often hidden).Closes #1058.
Method
When triggered, the background script captures the current tab's URL, stores it in session storage, and then opens the extension popup to complete the save flow. This mirrors the behavior of the context menu option. The context menu handler was refactored to reuse the same logic.
Testing
To test, download and install the appropriate
.zip
file below:For Firefox (and Firefox-based browsers like Zen):
Go to
about:debugging
, clickThis Firefox
in the left sidebar, then clickLoad Temporary Add-on
. Select the.zip
file to install.For Chrome (and Chromium-based browsers):
Go to
chrome://extensions
, enable Developer mode, extract the.zip
file, and drag the extracted folder onto the tab to install.Notes
To change the keyboard shortcut:
chrome://extensions/shortcuts
and change as desired