spot: more checks for bg

This commit is contained in:
nick-delirium 2025-05-23 11:25:09 +02:00
parent fa9c4d3398
commit 04a63e3f84
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 5 additions and 3 deletions

View file

@ -943,7 +943,7 @@ export default defineBackground(() => {
});
}
for (const tab of await chrome.tabs.query({})) {
if (tab.url?.match(/(chrome|chrome-extension):\/\//gi)) {
if (tab.url?.match(/(chrome|chrome-extension):\/\//gi) || !tab.id) {
continue;
}
const res = await browser.scripting.executeScript({
@ -953,6 +953,7 @@ export default defineBackground(() => {
console.log('restoring content at', res)
}
await checkTokenValidity();
void initializeOffscreenDocument();
});
void initializeOffscreenDocument();

View file

@ -28,7 +28,6 @@ export default defineContentScript({
append: "first",
onMount: (container, s, host) => {
Object.assign(host.style, { visibility: "visible", display: "block" });
return render(
() => (
<ControlsBox
@ -55,7 +54,9 @@ export default defineContentScript({
unmount?.();
},
});
ctx.onInvalidated(() => {
ui.remove();
});
let micResponse: boolean | null = null;
const getMicStatus = async () => {
return new Promise((res) => {