Helper functions allowing you to return info about the users OS and browser.
When importing EvoToolkit directly as a compiled .js
file without a build step, you can still use these tools through the global EvoToolkit object.
window.evotoolkit.tools.toolName()
For getBrowser()
, a list of supported responses are:
ie
firefox
edge
safari
chrome
false
(if none of the above)import getEnv, { getBrowser } from './../../../node_modules/evotoolkit/src/js/tools/getEnv.js';
// Using the methods whilst encapsulated in their parent object
const browser = getEnv.browser();
// If using named import, you can call the function directly
const browser = getBrowser();
For getOS()
, a list of supported responses are:
ios
false
(if none of the above)import getEnv, { getOS } from './../../../node_modules/evotoolkit/src/js/tools/getEnv.js';
// Using the methods whilst encapsulated in their parent object
const os = getEnv.os();
// If using named import, you can call the function directly
const os = getOS();