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
|
|
|
});
|
|
|
|
|
|
|
|
const isSender = location.pathname.includes('/download');
|
|
|
|
|
|
|
|
gcmCompliant().catch(err => {
|
|
|
|
$('#page-one').attr('hidden', true);
|
|
|
|
$('#download').attr('hidden', true);
|
|
|
|
sendEvent(isSender ? 'sender' : 'recipient', 'unsupported', {
|
|
|
|
cd6: err
|
|
|
|
}).then(() => {
|
|
|
|
location.replace('/unsupported');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
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(() => {
|
|
|
|
location.replace('/unsupported');
|
|
|
|
});
|
|
|
|
}
|