Check for Android using userAgent

Modern Android systems seem to report "Linux" for navigator.platform, so
we can no longer rely on that.
This commit is contained in:
Pierre Ossman
2022-12-23 16:58:45 +01:00
parent a187821e4f
commit 12a7c6f0de
2 changed files with 8 additions and 6 deletions

View File

@@ -94,7 +94,8 @@ export function isIOS() {
}
export function isAndroid() {
return !!(/android/i).exec(navigator.platform);
/* Android sets navigator.platform to Linux :/ */
return !!navigator.userAgent.match('Android ');
}
export function isChromeOS() {