spot: more checks for bg
This commit is contained in:
parent
fa9c4d3398
commit
04a63e3f84
2 changed files with 5 additions and 3 deletions
|
|
@ -943,7 +943,7 @@ export default defineBackground(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (const tab of await chrome.tabs.query({})) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
const res = await browser.scripting.executeScript({
|
const res = await browser.scripting.executeScript({
|
||||||
|
|
@ -953,6 +953,7 @@ export default defineBackground(() => {
|
||||||
console.log('restoring content at', res)
|
console.log('restoring content at', res)
|
||||||
}
|
}
|
||||||
await checkTokenValidity();
|
await checkTokenValidity();
|
||||||
|
void initializeOffscreenDocument();
|
||||||
});
|
});
|
||||||
void initializeOffscreenDocument();
|
void initializeOffscreenDocument();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ export default defineContentScript({
|
||||||
append: "first",
|
append: "first",
|
||||||
onMount: (container, s, host) => {
|
onMount: (container, s, host) => {
|
||||||
Object.assign(host.style, { visibility: "visible", display: "block" });
|
Object.assign(host.style, { visibility: "visible", display: "block" });
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
() => (
|
() => (
|
||||||
<ControlsBox
|
<ControlsBox
|
||||||
|
|
@ -55,7 +54,9 @@ export default defineContentScript({
|
||||||
unmount?.();
|
unmount?.();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
ctx.onInvalidated(() => {
|
||||||
|
ui.remove();
|
||||||
|
});
|
||||||
let micResponse: boolean | null = null;
|
let micResponse: boolean | null = null;
|
||||||
const getMicStatus = async () => {
|
const getMicStatus = async () => {
|
||||||
return new Promise((res) => {
|
return new Promise((res) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue