How to use the bowser.tablet 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 eface2face / rtcninja.js / lib / rtcninja.js View on Github external
// Dependencies.

var browser = require('bowser'),
	debug = require('debug')('rtcninja'),
	debugerror = require('debug')('rtcninja:ERROR'),
	version = require('./version'),
	Adapter = require('./Adapter'),
	RTCPeerConnection = require('./RTCPeerConnection'),

	// Internal vars.
	called = false;

debugerror.log = console.warn.bind(console);
debug('version %s', version);
debug('detected browser: %s %s [mobile:%s, tablet:%s, android:%s, ios:%s]',
		browser.name, browser.version, !!browser.mobile, !!browser.tablet,
		!!browser.android, !!browser.ios);


// Constructor.

function rtcninja(options) {
	// Load adapter
	var iface = Adapter(options || {});  // jshint ignore:line

	called = true;

	// Expose RTCPeerConnection class.
	rtcninja.RTCPeerConnection = RTCPeerConnection;

	// Expose WebRTC API and utils.
	rtcninja.getUserMedia = iface.getUserMedia;
github OneSignal / OneSignal-Website-SDK / src / utils.js View on Github external
export function isPushNotificationsSupported () {
  if (Browser.ios || Browser.ipod || Browser.iphone || Browser.ipad)
    return false;

  if (Browser.msedge || Browser.msie)
    return false;

  /* Firefox on Android push notifications not supported until at least 48: https://bugzilla.mozilla.org/show_bug.cgi?id=1206207#c6 */
  if (Browser.firefox && Number(Browser.version) < 48 && (Browser.mobile || Browser.tablet)) {
    return false;
  }

  if (Browser.firefox && Number(Browser.version) >= 44)
    return true;

  if (Browser.safari && Number(Browser.version) >= 7.1)
    return true;

  // Android Chrome WebView
  if (navigator.appVersion.match(/ wv/))
    return false;

  if (Browser.chrome && Number(Browser.version) >= 42)
    return true;
github srtucker22 / glipchat / client / routes.js View on Github external
// if current room changes to id, route to that room
    // don't route if already there
    // can only already be at this route if the app was loaded directly at this path (e.g. a user clicks a link to the room from their email)
    const nextPath = `/room/${currentRoom}`;
    if(!!currentRoom && window.location.pathname !== nextPath) {
      browserHistory.push(nextPath);
    }
  }
});

// route configuration
export const routeConfig = [{
  path: '/',
  component: AppComponent,
  indexRoute: {
    component: (Browser.mobile || Browser.tablet) ?
      HomeMobileComponent : HomeComponent,
  },
  onEnter: (nextState, replaceState) => {
    analytics.page('home');
  },
  childRoutes: [{
    path: '/room/:roomId',
    component: RoomComponent,
    onEnter: (nextState, replaceState, callback) => { // use a callback to make onEnter async
      // subscribe to redux changes

      let {users: {user}, rooms} = store.getState();

      // if user logged in and new room, set current room
      if(!!user && !user.loggingIn && (!rooms.current || rooms.current !== nextState.params.roomId)) {
        store.dispatch(Actions.setCurrentRoom(nextState.params.roomId));
github recurly / recurly-js / lib / recurly / hosted-field.js View on Github external
function isMobile () {
  return bowser.mobile || bowser.tablet;
}
github edcarroll / ng2-semantic-ui / src / modules / datepicker / directives / input.directive.ts View on Github external
public set useNativeOnMobile(fallback:boolean) {
        this._useNativeOnMobile = fallback;
        const isOnMobile = bowser.mobile || bowser.tablet || isWebView(navigator.userAgent);
        this.fallbackActive = this.useNativeOnMobile && isOnMobile;
    }
github OneSignal / OneSignal-Website-SDK / src / bell / Dialog.ts View on Github external
imageUrl = '/bell/chrome-unblock.jpg';
        }
        else if (bowser.firefox)
          imageUrl = '/bell/firefox-unblock.jpg';
        else if (bowser.safari)
          imageUrl = '/bell/safari-unblock.jpg';
        else if (bowser.msedge)
          imageUrl = '/bell/edge-unblock.png';

        let instructionsHtml = '';
        if (imageUrl) {
          imageUrl = SdkEnvironment.getOneSignalApiUrl().origin + imageUrl;
          instructionsHtml = `<a href="${imageUrl}"><img src="${imageUrl}"></a>`;
        }

        if ((bowser.mobile || bowser.tablet) &amp;&amp; bowser.chrome) {
          instructionsHtml = `<ol><li>Access <strong>Settings</strong> by tapping the three menu dots <strong>⋮</strong></li><li>Click <strong>Site settings</strong> under Advanced.</li><li>Click <strong>Notifications</strong>.</li><li>Find and click this entry for this website.</li><li>Click <strong>Notifications</strong> and set it to <strong>Allow</strong>.</li></ol>`;
        }
        contents = `<h1>${this.bell.options.text['dialog.blocked.title']}</h1><div class="divider"></div><div class="instructions"><p>${this.bell.options.text['dialog.blocked.message']}</p>${instructionsHtml}</div>${footer}`;
      }
      if (this.nestedContentSelector) {
        addDomElement(this.nestedContentSelector, 'beforeend', contents);
      }
      if (this.subscribeButton) {
        this.subscribeButton.addEventListener('click', () =&gt; {
          /*
            The welcome notification should only be shown if the user is
            subscribing for the first time and resubscribing via the notify
            button.

            If permission is already granted, __doNotShowWelcomeNotification is
            set to true to prevent showing a notification, but we actually want
github CircularRhythm / CircularRhythm / src / script / main.js View on Github external
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",
        bpm: { initial: 125, min: 120, max: 150 },
github LessWrong2 / Lesswrong2 / packages / lesswrong / lib / collections / users / helpers.js View on Github external
const clientRequiresMarkdown = () => {
  if (Meteor.isClient &&
      window &&
      window.navigator &&
      window.navigator.userAgent) {

      return (bowser.mobile || bowser.tablet)
  }
  return false
}