fix(web-clipper): toast not working

This commit is contained in:
Elian Doran 2026-01-24 11:13:17 +02:00
parent 5600a707d3
commit c0a2ae99cf
No known key found for this signature in database
2 changed files with 1 additions and 14 deletions

View File

@ -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();

View File

@ -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);
}
});