How to use the bowser.mac function in bowser

To help you get started, we’ve selected a few bowser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github srtucker22 / glipchat / client / index.js View on Github external
*/

import 'react-fastclick';
import 'webrtc-adapter';
import 'buffer';
import { analytics } from 'meteor/okgrow:analytics';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import Browser from 'bowser';
import injectTapEventPlugin from 'react-tap-event-plugin';
import React from 'react';
import * as config from '../lib/config';
import Root from './components/root.component';
import Electron from './utils/electron.utils';

Browser.mac = /(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/
  .test(navigator.userAgent) && !Browser.ios;
Browser.electron = Electron.isDesktop();

injectTapEventPlugin();

Meteor.startup(() => {
  if (Meteor.isDevelopment) {
    analytics.debug();  // show the analytics debug log if testing locally
  }

  render(
    ,
    document.getElementById('root'),
  );

  document.title = config.APP_NAME; // set the title for the app
github Jam3 / nyg-jam3 / templates / src / util / detect.js View on Github external
const checkDevicePixelRatio = () => window.devicePixelRatio;
const checkFacebook = () => /fban|fbav/.test(ua);
const checkTwitter = () => /twitter/.test(ua);
const checkInstagram = () => /instagram/.test(ua);
const checkPinterest = () => /pinterest/.test(ua);

// Bot flags
const isBot = checkBot();

// OS flags
const isiOS = bowser.ios === true;
const isAndroid = bowser.android === true;
const isFirefoxOS = bowser.firefoxos === true;
const isWindowsPhone = bowser.windowsphone === true;
const isBlackberry = bowser.blackberry === true;
const isMac = bowser.mac === true;
const isWindows = bowser.windows === true;
const isLinux = bowser.linux === true;
const isChromeOS = bowser.chromeos === true;

// Device flags
const isPhone = bowser.mobile === true;
const isTablet = bowser.tablet === true;
const isMobile = isPhone || isTablet;
const isDesktop = !isMobile;
const isiPhone = isiOS && bowser.iphone === true;
const isiPad = isiOS && bowser.ipad === true;
const isiPod = isiOS && bowser.ipod === true;

// Browser flags
const isChrome = bowser.chrome === true;
const isFirefox = bowser.firefox === true;
github LivelyKernel / lively.morphic / config.js View on Github external
/*global System*/
import { Rectangle, Color } from "lively.graphics";
import bowser from "bowser";

const isMac = !!bowser.mac;

if (typeof $world !== "undefined") {
  $world.withAllSubmorphsDo(ea =>
    ea.hasOwnProperty("_cachedKeyhandlers") && (ea._cachedKeyhandlers = null));
}

function parseURLQuery() {
  if (typeof document === "undefined" || !document.location) return {};
  var search = (document.location.hash || document.location.search).slice(1),
      args = search && search.split("&"),
      options = {};
  if (args) for (var i = 0; i < args.length; i++) {
    var keyAndVal = args[i].split("="),
        key = keyAndVal[0],
        val = true;
    if (keyAndVal.length > 1) {
github srtucker22 / glipchat / client / lib / app.browserify.js View on Github external
Browser = require('bowser');
Browser.mac = /(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/
  .test(navigator.userAgent) && !Browser.ios;
Browser.electron = Electron.isDesktop();

TagsInput = require('react-tagsinput');
require('webrtc-adapter-test');
ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
ReactScrollComponents = require('react-scroll-components');
Q = require('q');
injectTapEventPlugin();

Meteor.startup(function() {
  if (WebAppCordova) {
    var fileUrlRegEx = /^file:\/\/(.*)/;
    WebAppCordova.localFileSystemUrl = function(fileUrl) {
      var match = fileUrlRegEx.exec(fileUrl);
      if (!match) return fileUrl;
github LivelyKernel / lively.next / lively.morphic / events / Event.js View on Github external
isCommandKey() {
    var domEvt = this.domEvt;
    if (!domEvt) return false;
    var isCmd = false;
    if (!bowser.mac)
        isCmd = isCmd || domEvt.ctrlKey;
    if (bowser.tablet || bowser.tablet)
        isCmd = isCmd || false/*FIXME!*/
    return isCmd || domEvt.metaKey || domEvt.keyIdentifier === 'Meta';
  }
github 0xProject / 0x-monorepo / packages / instant / src / util / env.ts View on Github external
getOperatingSystem(): OperatingSystem {
        if (bowser.android) {
            return OperatingSystem.Android;
        } else if (bowser.ios) {
            return OperatingSystem.iOS;
        } else if (bowser.mac) {
            return OperatingSystem.Mac;
        } else if (bowser.windows) {
            return OperatingSystem.Windows;
        } else if (bowser.windowsphone) {
            return OperatingSystem.WindowsPhone;
        } else if (bowser.linux) {
            return OperatingSystem.Linux;
        } else {
            return OperatingSystem.Other;
        }
    },
    getProviderType(provider: ZeroExProvider): ProviderType | undefined {
github srtucker22 / glipchat / client / components / error.component.js View on Github external
export const NotSupportedErrorComponent = ({action})=> {
  return (
    <div style="{[styles.general.css]}">
      <div>
        <img style="{[styles.general.icon.css]}/" src="/images/astronaut.png">
        <p>{`Sorry, we do not currently support your browser.`}</p>
        <p>You can download <a href="https://www.google.com/chrome/">Google Chrome</a> or <a href="https://www.mozilla.org/firefox">Mozilla Firefox</a> for free to use this video chatroom.</p>
        <br>
        {(Browser.mac &amp;&amp; !Browser.electron) ?
           : ''}
        <br>
        
      </div>
    </div>
  );
};
NotSupportedErrorComponent.propTypes ={
github srtucker22 / glipchat / client / components / home.component.js View on Github external
: ''
        }
        <div style="{[GlobalStyles.stickyFooterPage]}">
          
          <div>
            <div>
              <h1 style="{[styles.title.css]}">{APP_NAME}</h1>
              <br>
              
              <br>
              {(Browser.mac &amp;&amp; !Browser.electron) ?
                 : ''}
            </div>
          </div>
        </div>
        
      
    );
  }
}
github 0xProject / 0x-monorepo / packages / website / ts / utils / utils.ts View on Github external
getOperatingSystem(): OperatingSystemType {
        if (bowser.android) {
            return OperatingSystemType.Android;
        } else if (bowser.ios) {
            return OperatingSystemType.iOS;
        } else if (bowser.mac) {
            return OperatingSystemType.Mac;
        } else if (bowser.windows) {
            return OperatingSystemType.Windows;
        } else if (bowser.windowsphone) {
            return OperatingSystemType.WindowsPhone;
        } else if (bowser.linux) {
            return OperatingSystemType.Linux;
        } else {
            return OperatingSystemType.Other;
        }
    },
    isTokenTracked(token: Token): boolean {
github LivelyKernel / lively.morphic / events.js View on Github external
isCommandKey(domEvt) {
      var isCmd = false;
      if (!bowser.mac)
          isCmd = isCmd || domEvt.ctrlKey;
      if (bowser.tablet || bowser.tablet)
          isCmd = isCmd || false/*FIXME!*/
      return isCmd || domEvt.metaKey || domEvt.keyIdentifier === 'Meta';
  },
  isShiftDown(domEvt) { return !!domEvt.shiftKey },