spot: close offscreen doc before reinit

This commit is contained in:
nick-delirium 2025-05-23 10:13:36 +02:00
parent 58111d2323
commit 3410aec605
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -965,13 +965,11 @@ export default defineBackground(() => {
(c: { contextType: string }) => c.contextType === "OFFSCREEN_DOCUMENT",
);
if (offscreenDocument) {
return;
// TODO: check manifestv3 for reloading context
// try {
// await browser.offscreen.closeDocument();
// } catch (e) {
// console.trace(e)
// }
try {
await browser.offscreen.closeDocument();
} catch (e) {
console.error("Spot: error closing old offscreen document", e);
}
}
try {