use webcrypto-liner to support Safari 10
This commit is contained in:
parent
4d4098b7c9
commit
fb41a40128
7 changed files with 770 additions and 657 deletions
|
@ -1,35 +1,30 @@
|
|||
window.Raven = require('raven-js');
|
||||
const testPilotGA = require('testpilot-ga');
|
||||
const { sendEvent } = require('./utils');
|
||||
const Raven = require('raven-js');
|
||||
|
||||
if (navigator.doNotTrack !== '1' && window.RAVEN_CONFIG) {
|
||||
window.Raven.config(window.SENTRY_ID, window.RAVEN_CONFIG).install();
|
||||
Raven.config(window.SENTRY_ID, window.RAVEN_CONFIG).install();
|
||||
}
|
||||
|
||||
const testPilotGA = require('testpilot-ga');
|
||||
const { gcmCompliant, sendEvent } = require('./utils');
|
||||
window.analytics = new testPilotGA({
|
||||
const analytics = new testPilotGA({
|
||||
an: 'Firefox Send',
|
||||
ds: 'web',
|
||||
tid: window.GOOGLE_ANALYTICS_ID
|
||||
});
|
||||
|
||||
const isSender = !location.pathname.includes('/download');
|
||||
const ec = isSender ? 'sender' : 'recipient';
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
|
||||
gcmCompliant().catch(err => {
|
||||
sendEvent(ec, 'unsupported', {
|
||||
cd6: err
|
||||
}).then(() => {
|
||||
location.replace('/unsupported/gcm');
|
||||
});
|
||||
});
|
||||
|
||||
if (
|
||||
ua.indexOf('firefox') > -1 &&
|
||||
parseInt(ua.match(/firefox\/*([^\n\r]*)\./)[1], 10) <= 49
|
||||
) {
|
||||
const isSender = !location.pathname.includes('/download');
|
||||
const ec = isSender ? 'sender' : 'recipient';
|
||||
sendEvent(ec, 'unsupported', {
|
||||
cd6: new Error('Firefox is outdated.')
|
||||
}).then(() => {
|
||||
location.replace('/unsupported/outdated');
|
||||
});
|
||||
}
|
||||
|
||||
window.analytics = analytics;
|
||||
window.Raven = Raven;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue