| 123456789101112131415161718192021222324252627282930313233343536373839 |
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /* globals navigator:false */
- /**
- * @module utils/env
- */
- const userAgent = navigator.userAgent.toLowerCase();
- /**
- * A namespace containing environment and browser information.
- *
- * @namespace
- */
- const env = {
- /**
- * Indicates that application is running on Macintosh.
- *
- * @static
- * @member {Boolean} module:utils/env~env#mac
- */
- mac: isMac( userAgent )
- };
- export default env;
- /**
- * Checks if User Agent represented by the string is running on Macintosh.
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is running on Macintosh or not.
- */
- export function isMac( userAgent ) {
- return userAgent.indexOf( 'macintosh' ) > -1;
- }
|