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