How to use the detect-browser.name function in detect-browser

To help you get started, we’ve selected a few detect-browser 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 contra / rtc-everywhere / platforms / chrome / match.js View on Github external
module.exports = function(){
  var browser = require('detect-browser');
  return typeof window !== 'undefined' &&
    typeof window.chrome !== 'undefined' &&
    browser.name === 'chrome';
};
github contra / rtc-everywhere / lib / temasys / isInstalled.js View on Github external
module.exports = function(){
  var browser = require('detect-browser');
  if (browser.name === 'safari') {
    return getPlugins()[pluginName];
  }
  if (browser.name === 'ie') {
    return AXExists(companyPrefix, pluginName);
  }
  return false;
};
github contra / rtc-everywhere / platforms / ie / match.js View on Github external
module.exports = function(){
  var browser = require('detect-browser');
  return browser.name === 'ie';
};
github y-a-r-g / color-themes / frontend / components / DownloadBar / DownloadBar.jsx View on Github external
onDownloadClick(event) {
        try {
            if (browser.name === "chrome" || browser.name === "firefox") {
                var builderName = event.target.getAttribute("data-builder");
                var builder = Builders[builderName];
                builder.build_p(this.props.theme)
                    .then(built => {
                        FileSaver.saveAs(built.data, built.name);
                        Themes.increaseDowloadCounter(this.props.theme._id);
                    })
                .catch(err => Application.showError(err));

                event.stopPropagation();
                event.preventDefault();
            }
        }
        catch(err) {
        }
    }
github patrickheng / vuejs-webpack-boilerplate / src / core / States.js View on Github external
constructor() {

    this.userAgent = window.navigator.userAgent;
    this.mobileDetect = new MobileDetect( this.userAgent );
    this.deviceType = this.getDeviceType();
    this.browserName = browser.name;

    this.isDesktop = ( this.deviceType === 'desktop' );
    this.isTablet  = ( this.deviceType  === 'tablet' );
    this.isMobile  = ( this.deviceType  === 'mobile' );
  }
github emoji-gen / web-main / frontend_old / view / components / organisms / result / index.js View on Github external
isRegisterSupportedBrowser() {
      return browser.name === 'chrome' || browser.name === 'firefox'
    },
    visibleRegisterButton() {
github seejamescode / global-upvote / src / App.js View on Github external
componentDidMount() {
    this.setState({
      browser: browser.name,
      usingExtension: window.self !== window.top,
      version: parseFloat(browser.version)
    });
    this.getStories();
    window.addEventListener("offline", this.toggleConnection);
    window.addEventListener("online", this.toggleConnection);

    if (window.location.hostname !== "localhost") {
      ReactGA.initialize("UA-43808769-9");
      ReactGA.pageview("pageview");
    }
  }
github diplomatiegouvfr / hornet-js / hornet-js-core / src / services / superagent-hornet-plugins.ts View on Github external
return function (request: HornetSuperAgentRequest) {
            if (!Utils.isServer && browser.name === "ie") {
                request.set("If-Modified-Since", "Sun, 12 Jul 1998 05:00:00 GMT");
                request.set("Cache-Control", "no-cache, no-store, must-revalidate");
                request.set("Pragma", "no-cache");
                request.set("Expires", "0");
            }
        }
    }
github contra / rtc-everywhere / platforms / edge / match.js View on Github external
module.exports = function(){
  var browser = require('detect-browser');
  return browser.name === 'edge' &&
    window.RTCIceGatherer;
};

detect-browser

Unpack a browser type and version from the useragent string

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis