mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
14 lines
401 B
TypeScript
14 lines
401 B
TypeScript
|
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');
|
||
|
}
|