mirror of
https://github.com/zadam/trilium.git
synced 2026-01-31 10:54:25 +01:00
fix(web-clipper): toast not working
This commit is contained in:
parent
5600a707d3
commit
c0a2ae99cf
@ -421,9 +421,6 @@ export default defineBackground(() => {
|
||||
else if (request.name === 'closeTabs') {
|
||||
return await browser.tabs.remove(request.tabIds)
|
||||
}
|
||||
else if (request.name === 'load-script') {
|
||||
return await browser.tabs.executeScript({file: request.file});
|
||||
}
|
||||
else if (request.name === 'save-cropped-screenshot') {
|
||||
const activeTab = await getActiveTab();
|
||||
|
||||
|
||||
@ -275,7 +275,7 @@ export default defineContentScript({
|
||||
messageText = message.message;
|
||||
}
|
||||
|
||||
await requireLib('/lib/toast.js');
|
||||
await import("../../lib/toast");
|
||||
|
||||
showToast(messageText, {
|
||||
settings: {
|
||||
@ -343,16 +343,6 @@ export default defineContentScript({
|
||||
}
|
||||
}
|
||||
|
||||
const loadedLibs = [];
|
||||
|
||||
async function requireLib(libPath) {
|
||||
if (!loadedLibs.includes(libPath)) {
|
||||
loadedLibs.push(libPath);
|
||||
|
||||
await browser.runtime.sendMessage({name: 'load-script', file: libPath});
|
||||
}
|
||||
}
|
||||
|
||||
browser.runtime.onMessage.addListener(prepareMessageResponse);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user