Skip to content

Commit 148b3f6

Browse files
committed
fix(typing): fix chrome typing for other browsers
1 parent fe609e7 commit 148b3f6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type chrome from 'chrome';
12
import type { Component } from 'vue';
23
import type { DefineComponent, WebComponents } from '~/web/define-component';
34

@@ -11,3 +12,9 @@ type TraktExtension = {
1112
};
1213

1314
export type { TraktExtension, DefineComponent, WebComponents };
15+
16+
declare global {
17+
interface Window {
18+
chrome: typeof chrome;
19+
}
20+
}

src/utils/i18n.utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useI18nStore } from '~/stores/i18n.store';
66
import { useRouterStore } from '~/stores/router.store';
77

88
export const useI18n = (...roots: string[]): ReturnType<typeof chromeUseI18n> => {
9-
if (!chrome?.i18n) {
9+
if (!window?.chrome?.i18n) {
1010
const store = useI18nStore();
1111
const router = useRouterStore();
1212

0 commit comments

Comments
 (0)