drop.chapril.org-firefoxsend/frontend/src/common.js

31 lines
832 B
JavaScript
Raw Normal View History

2017-06-22 23:50:57 +02:00
window.Raven = require('raven-js');
window.Raven.config(window.dsn).install();
window.dsn = undefined;
const testPilotGA = require('testpilot-ga');
const {gcmCompliant, sendEvent} = require('./utils');
window.analytics = new testPilotGA({
an: 'Firefox Send',
ds: 'web',
tid: window.trackerId
2017-07-22 02:01:26 +02:00
});
gcmCompliant().catch(err => {
$('#page-one').attr('hidden', true);
$('#download').attr('hidden', true);
sendEvent('sender', 'unsupported', {
cd6: err
}).then(() => {
location.replace('/unsupported');
});
});
if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&
parseInt(navigator.userAgent.toLowerCase().match(/firefox\/*([^\n\r]*)\./)[1]) <= 49) {
2017-07-27 18:09:09 +02:00
sendEvent('sender', 'unsupported', {
cd6: 'Unsupported Firefox'
}).then(() => {
location.replace('/unsupported');
});
}