FIX: reimplemented the old stream behavior on bad navigators like chrome
This commit is contained in:
parent
62682cb18c
commit
fa9929757d
3 changed files with 121 additions and 69 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue