How to use the bowser.chrome 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 google / marzipano / src / stages / WebGl.js View on Github external
var pixelRatio = require('../util/pixelRatio');
var ispot = require('../util/ispot');
var setAbsolute = require('../util/dom').setAbsolute;
var setFullSize = require('../util/dom').setFullSize;
var clearOwnProperties = require('../util/clearOwnProperties');

var debug = typeof MARZIPANODEBUG !== 'undefined' && MARZIPANODEBUG.webGl;


// Browser-specific workarounds.
var browserQuirks = {
  // Whether to use texImage2D instead of texSubImage2D when repainting an
  // existing texture from a video element. On most browsers texSubImage2D is
  // faster, but on Chrome the performance degrades significantly. See:
  // https://bugs.chromium.org/p/chromium/issues/detail?id=612542
  videoUseTexImage2D: browser.chrome
};


function initWebGlContext(canvas, opts) {
  var options = {
    alpha: true,
    premultipliedAlpha: true,
    antialias: !!(opts && opts.antialias),
    preserveDrawingBuffer: !!(opts && opts.preserveDrawingBuffer)
  };

  if (debug && typeof WebGLDebugUtils !== 'undefined') {
    console.log('Using WebGL lost context simulator');
    canvas = WebGLDebugUtils.makeLostContextSimulatingCanvas(canvas);
  }
github OpenNeuroOrg / openneuro / src / scripts / common / forms / file-select.jsx View on Github external
_click (e) {
        React.findDOMNode(this.refs.fileSelect).value = null;
        e.stopPropagation();
        if (!bowser.chrome) {
            let chromeMessage = (
                <span>This is a Google Chrome only feature. <a href="http://www.google.com/chrome/">Please consider using Chrome as your browser</a>.</span>
            );
            e.preventDefault();
            notifications.createAlert({
                type: 'Error',
                message: chromeMessage
            });
        }
        if (this.state.uploadStatus === 'uploading') {
            e.preventDefault();
            notifications.createAlert({
                type: 'Warning',
                message: 'You may only upload one dataset at a time. Please wait for the current upload to finish, then try resuming again.'
            });
        }
github CircularRhythm / CircularRhythm / src / script / main.js View on Github external
const debugParam = getParameter("debug")
    const screenParam = getParameter("screen")
    const resetPreferenceParam = getParameter("resetpref")
    const forceCompatibilityWarningParam = getParameter("forcecompat")
    this.serverUrl = serverUrlParam ? serverUrlParam : "http://circularrhythm.github.io/OfficialMusicServer"
    this.debug = debugParam == "true"

    this.musicList = null
    this.localMusicList = []
    this.localFileList = new Map()
    this.preference = null

    if(resetPreferenceParam) window.localStorage.removeItem("preference")

    this.compatibilityWarning = []
    if(!Bowser.chrome) this.compatibilityWarning.push("Incompatible browser is detected. Currently only Google Chrome is supported. The game may not work correctly in other browsers.")
    if(Bowser.mobile && !Bowser.tablet) this.compatibilityWarning.push("Smartphone is detected. Playing this game with smartphones is discouraged.")

    this.screenManager = new ScreenManager(this)
    if(this.debug) {
      if(forceCompatibilityWarningParam == "true") {
        this.compatibilityWarning.push("Compatibility warning by debug parameter 1")
        this.compatibilityWarning.push("Compatibility warning by debug parameter 2")
        this.compatibilityWarning.push("Compatibility warning by debug parameter 3")
      }

      const testBmsonSetConfig = {
        title: "TyTLE",
        subtitle: "sub",
        artist: "aRtjst",
        subartists: ["sub"],
        genre: "tesTgenre",
github 0xProject / 0x-monorepo / packages / instant / src / util / env.ts View on Github external
getBrowser(): Browser {
        if (bowser.chrome) {
            return Browser.Chrome;
        } else if (bowser.firefox) {
            return Browser.Firefox;
        } else if (bowser.opera) {
            return Browser.Opera;
        } else if (bowser.msedge) {
            return Browser.Edge;
        } else if (bowser.safari) {
            return Browser.Safari;
        } else {
            return Browser.Other;
        }
    },
    isMobileOperatingSystem(): boolean {
github zenorocha / document.queryCommandSupported / src / queryCommandSupported.js View on Github external
document.queryCommandSupported = function(cmd) {
    if (cmd === 'copy' || cmd === 'cut') {
        if (bowser.chrome) {
            if (bowser.version &gt;= 43) {
                return true;
            }

            return false;
        }

        if (bowser.opera) {
            if (bowser.version &gt;= 30) {
                return true;
            }

            return false;
        }

        if (bowser.firefox &amp;&amp; bowser.version &lt; 41) {
github OpenNeuroOrg / openneuro / src / scripts / index.jsx View on Github external
render () {

        let pageClasses = ' ';
        let routes = this.getRoutes();

        for (let route of routes) { pageClasses += route.name + ' '; }
        let is_front        = this.isActive('signIn');

        return (
            <div>
                {!bowser.chrome ?   : null }
                <div>
                    
                    <div>
                        <div>
                            
                        </div>
                    </div>
                </div>
            </div>
        );
    }