Fix top-level await
This commit is contained in:
parent
d605f4caca
commit
0b29b3dabd
1 changed files with 28 additions and 26 deletions
|
@ -4,6 +4,7 @@ export const supportsBrowserTranslator =
|
||||||
// https://developer.chrome.com/docs/ai/language-detection
|
// https://developer.chrome.com/docs/ai/language-detection
|
||||||
export let langDetector;
|
export let langDetector;
|
||||||
if (supportsBrowserTranslator) {
|
if (supportsBrowserTranslator) {
|
||||||
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const languageDetectorCapabilities =
|
const languageDetectorCapabilities =
|
||||||
await self.ai.languageDetector.capabilities();
|
await self.ai.languageDetector.capabilities();
|
||||||
|
@ -31,6 +32,7 @@ if (supportsBrowserTranslator) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://developer.chrome.com/docs/ai/translator-api
|
// https://developer.chrome.com/docs/ai/translator-api
|
||||||
|
|
Loading…
Add table
Reference in a new issue