11import { Capacitor } from "@capacitor/core" ;
2+ import { isTauri } from "@tauri-apps/api/core" ;
23
34// Detects OS using modern userAgentData API with fallback to legacy platform
45// Returns standardized OS name string or "unknown"
@@ -60,17 +61,14 @@ export function isCapacitorWeb() {
6061 return false ;
6162}
6263
63- export function isTauri ( ) {
64- return "__TAURI_INTERNALS__" in window ;
65- }
66-
6764export function checkBrowserCompatibility ( ) {
6865 const isWebSerial = checkWebSerialSupport ( ) ;
6966 const isWebBluetooth = checkWebBluetoothSupport ( ) ;
7067 const isWebUSB = checkWebUSBSupport ( ) ;
7168 const isChromium = isChromiumBrowser ( ) ;
7269
73- const isNative = Capacitor . isNativePlatform ( ) || isTauri ( ) ;
70+ const tauriDetected = isTauri ( ) ;
71+ const isNative = Capacitor . isNativePlatform ( ) || tauriDetected ;
7472
7573 // Check if running in a test environment
7674 const isTestEnvironment =
@@ -79,6 +77,7 @@ export function checkBrowserCompatibility() {
7977 const compatible = isTestEnvironment || isNative || ( isChromium && ( isWebSerial || isWebBluetooth || isWebUSB ) ) ;
8078
8179 console . log ( "User Agent: " , navigator . userAgentData ) ;
80+ console . log ( "Tauri detected: " , tauriDetected ) ;
8281 console . log ( "Native: " , isNative ) ;
8382 console . log ( "Chromium: " , isChromium ) ;
8483 console . log ( "Web Serial: " , isWebSerial ) ;
@@ -88,9 +87,9 @@ export function checkBrowserCompatibility() {
8887 console . log ( "iOS: " , isIOS ( ) ) ;
8988 console . log ( "Capacitor web: " , isCapacitorWeb ( ) ) ;
9089
91- // if (compatible) {
92- return true ;
93- // }
90+ if ( compatible ) {
91+ return true ;
92+ }
9493
9594 let errorMessage = "" ;
9695 if ( ! isChromium ) {
0 commit comments