fix: browser detection

This commit is contained in:
Ben Allfree 2026-02-22 10:47:51 -08:00
parent 9865a03c53
commit 377f1df445

View file

@ -4,12 +4,7 @@ import 'dart:html' as html;
class BrowserDetection {
static bool get isChrome {
final userAgent = html.window.navigator.userAgent.toLowerCase();
final vendor = html.window.navigator.vendor.toLowerCase();
// Chrome UA typically contains 'chrome' and vendor is 'Google Inc.'
// This also excludes Firefox, Safari, and sometimes Edge/Brave depending on strictness.
// For Web Bluetooth, Chrome, Edge (latest), and Brave usually work.
// But we'll follow the user's request for "isChrome".
return userAgent.contains('chrome') && vendor.contains('google');
final isChrome = userAgent.contains('chrome');
return isChrome;
}
}