2017-06-22 21:50:57 +00:00
|
|
|
window.Raven = require('raven-js');
|
|
|
|
window.Raven.config(window.dsn).install();
|
|
|
|
window.dsn = undefined;
|
2017-07-19 23:16:46 +00:00
|
|
|
|
|
|
|
const testPilotGA = require('testpilot-ga');
|
2017-07-27 15:13:59 +00:00
|
|
|
const {gcmCompliant, sendEvent} = require('./utils');
|
2017-07-19 23:16:46 +00:00
|
|
|
window.analytics = new testPilotGA({
|
|
|
|
an: 'Firefox Send',
|
|
|
|
ds: 'web',
|
|
|
|
tid: window.trackerId
|
2017-07-27 17:01:39 +00:00
|
|
|
});
|
|
|
|
|
2017-07-27 17:15:50 +00:00
|
|
|
const isSender = !location.pathname.includes('/download');
|
2017-07-27 17:01:39 +00:00
|
|
|
|
|
|
|
gcmCompliant().catch(err => {
|
|
|
|
sendEvent(isSender ? 'sender' : 'recipient', 'unsupported', {
|
|
|
|
cd6: err
|
|
|
|
}).then(() => {
|
2017-07-27 18:24:49 +00:00
|
|
|
location.replace('/unsupported/gcm');
|
2017-07-27 17:01:39 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&
|
|
|
|
parseInt(navigator.userAgent.toLowerCase().match(/firefox\/*([^\n\r]*)\./)[1]) <= 49) {
|
|
|
|
sendEvent(isSender ? 'sender' : 'recipient', 'unsupported', {
|
|
|
|
cd6: new Error('Firefox is outdated.')
|
|
|
|
}).then(() => {
|
2017-07-27 18:24:49 +00:00
|
|
|
location.replace('/unsupported/outdated');
|
2017-07-27 17:01:39 +00:00
|
|
|
});
|
|
|
|
}
|