You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
401 B
14 lines
401 B
4 years ago
|
import * as Bowser from "bowser"; // TypeScript
|
||
|
|
||
|
let parser: Bowser.Parser.Parser|undefined;
|
||
|
|
||
|
function getParser() {
|
||
|
return parser || (parser = Bowser.getParser(window.navigator.userAgent));
|
||
|
}
|
||
|
|
||
|
// Returns whether the browser we are in is a desktop browser.
|
||
|
export function isDesktop() {
|
||
|
const platformType = getParser().getPlatformType();
|
||
|
return (!platformType || platformType === 'desktop');
|
||
|
}
|