mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
Merge pull request #24 from siralmat/keyboard-shortcuts
Keyboard shortcuts
This commit is contained in:
commit
b61149382e
18
README.md
18
README.md
@ -1,5 +1,19 @@
|
||||
# Trilium Web Clipper
|
||||
Trilium Web Clipper is a web browser extension which allows user to clip text, screenshots, whole pages and short notes and save them directly to [Trilium Notes](https://github.com/zadam/trilium).
|
||||
|
||||
See details on [wiki page](https://github.com/zadam/trilium/wiki/Web-clipper).
|
||||
For more details, see the [wiki page](https://github.com/zadam/trilium/wiki/Web-clipper).
|
||||
|
||||
Some parts of the code are based on the [Joplin Notes](https://github.com/laurent22/joplin/tree/master/Clipper).
|
||||
## Keyboard shortcuts
|
||||
Keyboard shortcuts are available for most functions:
|
||||
* Save selected text: `Ctrl+Shift+S` (Mac: `Cmd+Shift+S`)
|
||||
* Save whole page: `Alt+Shift+S` (Mac: `Opt+Shift+S`)
|
||||
* Save screenshot: `Ctrl+Shift+E` (Mac: `Cmd+Shift+E`)
|
||||
|
||||
To set custom shortcuts, follow the directions for your browser.
|
||||
|
||||
**Firefox**: `about:addons` > Gear icon ⚙️ > Manage extension shortcuts
|
||||
|
||||
**Chrome**: `chrome://extensions/shortcuts`
|
||||
|
||||
## Credits
|
||||
Some parts of the code are based on the [Joplin Notes browser extension](https://github.com/laurent22/joplin/tree/master/Clipper).
|
||||
|
@ -1,3 +1,18 @@
|
||||
// Keyboard shortcuts
|
||||
chrome.commands.onCommand.addListener(async function (command) {
|
||||
if(command=="saveSelection") {
|
||||
await saveSelection();
|
||||
} else if (command == "saveWholePage") {
|
||||
await saveWholePage();
|
||||
} else if (command == "saveScreenshot") {
|
||||
const activeTab = await getActiveTab();
|
||||
await saveScreenshot(activeTab);
|
||||
} else {
|
||||
console.log("Unrecognized command", command);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function cropImage(newArea, dataUrl) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
|
@ -47,6 +47,26 @@
|
||||
"options_ui": {
|
||||
"page": "options/options.html"
|
||||
},
|
||||
"commands": {
|
||||
"saveSelection": {
|
||||
"description": "Save the selected text into a note",
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+S"
|
||||
}
|
||||
},
|
||||
"saveWholePage": {
|
||||
"description": "Save the current page",
|
||||
"suggested_key": {
|
||||
"default": "Alt+Shift+S"
|
||||
}
|
||||
},
|
||||
"saveScreenshot": {
|
||||
"description": "Take a screenshot of the current page",
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+E"
|
||||
}
|
||||
}
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "{1410742d-b377-40e7-a9db-63dc9c6ec99c}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user