mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
use correct active tab URL
This commit is contained in:
parent
097d319fca
commit
89984a7d96
@ -1,16 +1,16 @@
|
||||
// Keyboard shortcuts
|
||||
chrome.commands.onCommand.addListener(async function (command) {
|
||||
if(command=="saveSelection") {
|
||||
if (command == "saveSelection") {
|
||||
await saveSelection();
|
||||
} else if (command == "saveWholePage") {
|
||||
await saveWholePage();
|
||||
} else if (command == "saveScreenshot") {
|
||||
const activeTab = await getActiveTab();
|
||||
await saveScreenshot(activeTab);
|
||||
|
||||
await saveScreenshot(activeTab.url);
|
||||
} else {
|
||||
console.log("Unrecognized command", command);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function cropImage(newArea, dataUrl) {
|
||||
@ -323,7 +323,9 @@ browser.runtime.onMessage.addListener(async request => {
|
||||
return await browser.tabs.executeScript({file: request.file});
|
||||
}
|
||||
else if (request.name === 'save-screenshot') {
|
||||
return await saveScreenshot();
|
||||
const activeTab = await getActiveTab();
|
||||
|
||||
return await saveScreenshot(activeTab.url);
|
||||
}
|
||||
else if (request.name === 'save-whole-page') {
|
||||
return await saveWholePage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user