Skip to content

Commit

Permalink
fix offscreen tts conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ttop32 committed May 1, 2024
1 parent baab363 commit 0d63e28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,14 @@ export async function createOffscreen() {
try {
await browser?.offscreen?.createDocument({
url: "offscreen.html",
reasons: ["WORKERS"],
reasons: ["USER_MEDIA"],
justification: "TTS & Speech",
});
} catch (error) {
if (!error.message.startsWith("Only a single offscreen")) throw error;
if (error.message.startsWith("Only a single offscreen")) {
} else {
console.log(error);
}
}
}
export async function removeOffscreen() {
Expand Down

0 comments on commit 0d63e28

Please sign in to comment.