mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-19 23:31:03 +10:00
fix: browser detection
This commit is contained in:
@@ -4,12 +4,7 @@ import 'dart:html' as html;
|
|||||||
class BrowserDetection {
|
class BrowserDetection {
|
||||||
static bool get isChrome {
|
static bool get isChrome {
|
||||||
final userAgent = html.window.navigator.userAgent.toLowerCase();
|
final userAgent = html.window.navigator.userAgent.toLowerCase();
|
||||||
final vendor = html.window.navigator.vendor.toLowerCase();
|
final isChrome = userAgent.contains('chrome');
|
||||||
|
return isChrome;
|
||||||
// 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');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user