fox-send/frontend/src/common.js

23 lines
519 B
JavaScript
Raw Normal View History

const Raven = require('raven-js');
2017-08-05 19:23:58 +00:00
const { unsupported } = require('./metrics');
2017-08-02 21:13:53 +00:00
if (navigator.doNotTrack !== '1' && window.RAVEN_CONFIG) {
Raven.config(window.SENTRY_ID, window.RAVEN_CONFIG).install();
2017-08-02 21:13:53 +00:00
}
const ua = navigator.userAgent.toLowerCase();
if (
ua.indexOf('firefox') > -1 &&
parseInt(ua.match(/firefox\/*([^\n\r]*)\./)[1], 10) <= 49
) {
2017-08-05 19:23:58 +00:00
unsupported({
err: new Error('Firefox is outdated.')
}).then(() => {
location.replace('/unsupported/outdated');
});
}
module.exports = {
2017-08-05 19:23:58 +00:00
Raven
2017-08-05 16:52:37 +00:00
};