FIX: reimplemented the old stream behavior on bad navigators like chrome

This commit is contained in:
kharhamel 2021-09-07 12:07:23 +02:00
parent 62682cb18c
commit fa9929757d
3 changed files with 121 additions and 69 deletions

View file

@ -7,3 +7,23 @@ export function isIOS(): boolean {
(navigator.userAgent.includes("Mac") && "ontouchend" in document)
);
}
export enum NavigatorType {
firefox = 1,
chrome,
safari,
}
export function getNavigatorType(): NavigatorType {
if (window.navigator.userAgent.includes("Firefox")) {
return NavigatorType.firefox;
} else if (window.navigator.userAgent.includes("Chrome")) {
return NavigatorType.chrome;
} else if (window.navigator.userAgent.includes("Safari")) {
return NavigatorType.safari;
}
throw "Couldn't detect navigator type";
}
export function isAndroid(): boolean {
return window.navigator.userAgent.includes("Android");
}