fixes #319 - unsupported redirect
This commit is contained in:
parent
7237800a91
commit
6ff251b24a
1 changed files with 7 additions and 4 deletions
11
app/main.js
11
app/main.js
|
@ -21,20 +21,23 @@ app.use((state, emitter) => {
|
|||
state.storage = storage;
|
||||
state.raven = Raven;
|
||||
emitter.on('DOMContentLoaded', async () => {
|
||||
let reason = null;
|
||||
if (
|
||||
/firefox/i.test(navigator.userAgent) &&
|
||||
parseInt(navigator.userAgent.match(/firefox\/*([^\n\r]*)\./i)[1], 10) <=
|
||||
49
|
||||
) {
|
||||
return emitter.emit('replaceState', '/unsupported/outdated');
|
||||
reason = 'outdated';
|
||||
}
|
||||
if (/edge\/\d+/i.test(navigator.userAgent)) {
|
||||
return emitter.emit('replaceState', '/unsupported/edge');
|
||||
reason = 'edge';
|
||||
}
|
||||
const ok = await canHasSend(assets.get('cryptofill.js'));
|
||||
if (!ok) {
|
||||
const reason = /firefox/i.test(navigator.userAgent) ? 'outdated' : 'gcm';
|
||||
emitter.emit('replaceState', `/unsupported/${reason}`);
|
||||
reason = /firefox/i.test(navigator.userAgent) ? 'outdated' : 'gcm';
|
||||
}
|
||||
if (reason) {
|
||||
setTimeout(() => emitter.emit('replaceState', `/unsupported/${reason}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue