fix api check

This commit is contained in:
Aaron
2024-10-22 11:01:27 -05:00
parent e8e00e4e04
commit f75c5ca1aa
2 changed files with 2 additions and 2 deletions
@@ -11,7 +11,7 @@ import type {
const ANALYTICS_PORT = '@wxt-dev/analytics';
export function createAnalytics(config?: AnalyticsConfig): Analytics {
if (globalThis.chrome?.runtime?.id)
if (typeof chrome === 'undefined' || !chrome?.runtime?.id)
throw Error(
'Cannot use WXT analytics in contexts without access to the browser.runtime APIs',
);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@wxt-dev/analytics",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add analytics to your web extension",
"repository": {
"type": "git",