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

21 lines
497 B
JavaScript
Raw Normal View History

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