bigbluebutton-Github/bigbluebutton-html5/imports/utils/browserInfo.js
Gustavo Trott 531241d269
feat: Button to transfer user to mobile App (#15183)
* Provide a link to transfer user to mobile App
* show menu option only if appStoreLink is present and it is not running on mobile app already
2022-11-15 09:49:24 -03:00

34 lines
878 B
JavaScript

import Bowser from 'bowser';
const userAgent = window.navigator.userAgent;
const BOWSER_RESULTS = Bowser.parse(userAgent);
const isChrome = BOWSER_RESULTS.browser.name === 'Chrome';
const isSafari = BOWSER_RESULTS.browser.name === 'Safari';
const isEdge = BOWSER_RESULTS.browser.name === 'Microsoft Edge';
const isIe = BOWSER_RESULTS.browser.name === 'Internet Explorer';
const isFirefox = BOWSER_RESULTS.browser.name === 'Firefox';
const browserName = BOWSER_RESULTS.browser.name;
const versionNumber = BOWSER_RESULTS.browser.version;
const isValidSafariVersion = Bowser.getParser(userAgent).satisfies({
safari: '>12',
});
const isTabletApp = !!(userAgent.match(/BigBlueButton-Tablet/i));
const browserInfo = {
isChrome,
isSafari,
isEdge,
isIe,
isFirefox,
browserName,
versionNumber,
isValidSafariVersion,
isTabletApp
};
export default browserInfo;