Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
BackupGenerator.saveAsSupported = function() {
// a whole bunch of mobile OSs that are unsupported
if (bowser.browser.ios || bowser.browser.blackberry || bowser.browser.firefoxos ||
bowser.browser.webos || bowser.browser.bada || bowser.browser.tizen || bowser.browser.sailfish) {
return false;
}
if (bowser.browser.android) {
if (!bowser.browser.chrome) {
return false;
}
if (bowser.browser.version.split('.')[0] < 41) {
return false;
}
// not sure if this is required if the chrome version is >= 41
if (bowser.browser.osversion.split('.')[0] <= 4) {
return false;
}
}
return true;
};
BackupGenerator.saveAsSupported = function() {
// a whole bunch of mobile OSs that are unsupported
if (bowser.browser.ios || bowser.browser.blackberry || bowser.browser.firefoxos ||
bowser.browser.webos || bowser.browser.bada || bowser.browser.tizen || bowser.browser.sailfish) {
return false;
}
if (bowser.browser.android) {
if (!bowser.browser.chrome) {
return false;
}
if (bowser.browser.version.split('.')[0] < 41) {
return false;
}
// not sure if this is required if the chrome version is >= 41
if (bowser.browser.osversion.split('.')[0] <= 4) {
return false;
BackupGenerator.saveAsSupported = function() {
// a whole bunch of mobile OSs that are unsupported
if (bowser.browser.ios || bowser.browser.blackberry || bowser.browser.firefoxos ||
bowser.browser.webos || bowser.browser.bada || bowser.browser.tizen || bowser.browser.sailfish) {
return false;
}
if (bowser.browser.android) {
if (!bowser.browser.chrome) {
return false;
}
if (bowser.browser.version.split('.')[0] < 41) {
return false;
}
// not sure if this is required if the chrome version is >= 41
if (bowser.browser.osversion.split('.')[0] <= 4) {
return false;
app.get('*', function (req, res, next) {
// Check the user agent, and if is invalid, redirect to the page
// for browser update.
var userAgent = bowser.browser._detect(req.headers['user-agent'])
if (userAgent.msie && userAgent.version <= 9) {
res.redirect(302, '/browser-update')
} else {
next()
}
})
/**
* Dependencies.
*/
var browser = require('bowser').browser;
var domready = require('domready');
var debug = require('debug')('rtcninja:TemasysPlugin');
/**
* Local variables.
*/
var getUserMedia = null;
var RTCPeerConnection = null;
var RTCSessionDescription = null;
var RTCIceCandidate = null;
var MediaStreamTrack = null;
var attachMediaStream = null;
var browserVersion = Number(browser.version) || 0;
// The plugin HTML element.
'use strict';
var $ = require('./shims/jquery');
var _ = require('lodash');
var MainView = require('./views/main');
var Posts = require('./models/posts-collection');
var Router = require('./router');
var loadcss = require('./lib/loadcss');
var browser = require('bowser').browser;
var templates = require('./lib/posts-json.json');
module.exports = {
launch: _.once(function () {
var self = window.app = this;
var posts = [];
for (var key in templates) {
if (templates.hasOwnProperty(key)) {
posts.push({ slug: key });
}
}
// Create our global 'posts' object.
this.posts = new Posts(posts);
BOPlishClient = function(bootstrapHost, successCallback, errorCallback) {
if (!(this instanceof BOPlishClient)) {
return new BOPlishClient(bootstrapHost, successCallback, errorCallback);
} else if (typeof(bootstrapHost) !== 'string' || typeof(successCallback) !== 'function' || typeof(errorCallback) !== 'function') {
throw new TypeError('Not enough arguments or wrong type');
}
var self = this;
// when join fails, retry after 5s
self._joinDelay = bopclientConfig.joinDelay || 5000;
// number of retries
self._joinTrials = bopclientConfig.joinTrials || 3;
var browser = bowser.browser;
if (browser.firefox && browser.version >= 26) {
// we are on FF
} else if (browser.chrome && browser.version >= 33) {
// we are on Chrome
} else if (typeof(process) === 'object') {
// we are on Node.js
} else {
errorCallback('You will not be able to use BOPlish as your browser is currently incompatible. Please use either Firefox 26 or Chrome 33 upwards.');
return;
}
if (bootstrapHost.substring(bootstrapHost.length - 1, bootstrapHost.length) !== '/') { // add trailing slash if missing
bootstrapHost += '/';
}
if (bootstrapHost.substring(0, 6) !== 'wss://' && bootstrapHost.substring(0, 5) !== 'ws://') { // check syntax
errorCallback('Syntax error in bootstrapHost parameter');
(function (global){
/**
* Expose the Adapter function/object.
*/
module.exports = Adapter;
/**
* Dependencies.
*/
var browser = require('bowser').browser;
var debug = require('debug')('rtcninja:Adapter');
var debugerror = require('debug')('rtcninja:ERROR:Adapter');
debugerror.log = console.warn.bind(console);
/**
* Local variables.
*/
var getUserMedia = null;
var RTCPeerConnection = null;
var RTCSessionDescription = null;
var RTCIceCandidate = null;
var MediaStreamTrack = null;
var getMediaDevices = null;
var attachMediaStream = null;
var canRenegotiate = false;
var bowser = require('bowser').browser;
if (!bowser.chrome && !bowser.opera) {
alertUnsupportedBrowsers();
throw Error('unsupported browser');
}
window.am = require('./am/am');
function alertUnsupportedBrowsers() {
var deSorry = document.createElement('div');
deSorry.textContent = 'Sorry, this demo is currently only supported by the newest chrome and opera.';
deSorry.style.display = 'fixed';
deSorry.style.margin = 'auto';
deSorry.style.fontFamily = 'Open Sans';
},{}],2:[function(require,module,exports){
var bowser = require('bowser').browser;
if (bowser.android || bowser.iphone || bowser.ipad || bowser.touchpad) {
var hash = window.location.hash;
window.location.href = '/mobile.html' + hash;
}
if (bowser.msie && parseFloat(bowser.version) < 10) {
window.location.href = '/unsupported.html';
}
},{"bowser":1}]},{},[2])