Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function init() {
if (typeof window !== 'undefined') {
if (window && window.navigator) {
UA = new UAParser();
browser = UA.getBrowser();
cpu = UA.getCPU();
device = UA.getDevice();
engine = UA.getEngine();
os = UA.getOS();
ua = UA.getUA();
}
}
}
const UAParser = require("ua-parser-js/dist/ua-parser.min");
export const UA = new UAParser();
export const browser = UA.getBrowser();
export const cpu = UA.getCPU();
export const device = UA.getDevice();
export const engine = UA.getEngine();
export const os = UA.getOS();
export const ua = UA.getUA();
export const setUA = uaStr => UA.setUA(uaStr);
export const mockUserAgent = userAgent => {
window.navigator.__defineGetter__("userAgent", () => userAgent);
};
export const setDefaults = (p, d = "none") => (p ? p : d);
export const isIOS13Check = type => {
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var React__default = _interopDefault(React);
var UAParser = require('ua-parser-js/dist/ua-parser.min');
var UA = new UAParser();
var browser = UA.getBrowser();
var cpu = UA.getCPU();
var device = UA.getDevice();
var engine = UA.getEngine();
var os = UA.getOS();
var ua = UA.getUA();
var setDefaults = function setDefaults(p) {
var d = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'none';
return p ? p : d;
};
var getNavigatorInstance = function getNavigatorInstance() {
if (typeof window !== 'undefined') {
if (window.navigator || navigator) {
return window.navigator || navigator;
}