chrome required screen

This commit is contained in:
Ben Allfree committed 2026-02-22 07:40:40 -08:00
1 parent b5e47ce44f
commit 5676cbd84e
37 files changed
+268 -1

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
// ignore: avoid_web_libraries_in_flutter
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');
}
}