mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 11:05:47 +00:00
6718e7ef65
* move bad browser check into standalone files * refactor dup var * remove console logs * have warning support all browser versions * Revert "have warning support all browser versions". Webpack conventions still cause IE8 to break. This reverts commit a8531038622d2419a3da342ddfe0c356a90e4eee. * correct typo
34 lines
852 B
JavaScript
34 lines
852 B
JavaScript
var badBrowser = false;
|
|
|
|
try {
|
|
// Local storage
|
|
window.localStorage.setItem('test', 'test');
|
|
window.localStorage.removeItem('test');
|
|
|
|
// Flexbox
|
|
var elTest = document.createElement('div');
|
|
elTest.style.display = 'flex';
|
|
if (elTest.style.display !== 'flex') {
|
|
badBrowser = true;
|
|
}
|
|
|
|
// const and let check from badBrowserCheckA.js
|
|
if (window.localStorage.goodBrowser !== 'true') {
|
|
badBrowser = true;
|
|
}
|
|
window.localStorage.removeItem('goodBrowser');
|
|
|
|
} catch (err) {
|
|
badBrowser = true;
|
|
}
|
|
|
|
if (badBrowser) {
|
|
var el = document.getElementsByClassName('BadBrowser')[0];
|
|
el.className += ' is-open';
|
|
// Dumb check for known mobile OS's. Not important to catch all, just
|
|
// displays more appropriate information.
|
|
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
|
el.className += ' is-mobile';
|
|
}
|
|
}
|