mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-22 18:19:59 +01:00
#1254 getBrowserInfo - fix includes
This commit is contained in:
parent
552bf6f07f
commit
bf3041195b
@ -34,7 +34,7 @@ const getBrowserInfo = () => {
|
||||
|
||||
const isBrave = () => {
|
||||
if (navigator?.userAgentData?.brands) {
|
||||
return navigator.userAgentData.brands.filter(item => item.brand.includes('Brave')).length > 0;
|
||||
return navigator.userAgentData.brands.filter(item => item?.brand?.includes('Brave')).length > 0;
|
||||
} else if (navigator.brave !== undefined) {
|
||||
return navigator.brave.isBrave.name === 'isBrave';
|
||||
} else {
|
||||
@ -43,7 +43,7 @@ const getBrowserInfo = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
browserVersion = navigator.userAgentData.brands.filter(item => !item.brand.includes('Brand') && !item.brand.includes('Chromium'))[0].version;
|
||||
browserVersion = navigator.userAgentData.brands.filter(item => !item?.brand?.includes('Brand') && !item?.brand?.includes('Chromium'))[0]?.version;
|
||||
} catch (e) {
|
||||
const uA = navigator.userAgent.match(userAgent[process.env.EXT_PLATFORM]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user