There's a new way how you can get the browser brand in Chromium browsers:
navigator.userAgentData?.brands?.some(b => b.brand === 'Google Chrome')
But navigator.userAgentData is not available in Safari now, so need to fix the isSafariBrowser function to check if navigator.userAgent is available or not before call it.
Hello!
Recently Google Chrome started showing warnings because of
navigator.userAgent
usage.https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html
Seems Chromium team is going to deprecate
navigator.userAgent
and it's not a reliable way to check the user's browser anymore.The source of warnings: https://github.com/AdguardTeam/ExtendedCss/blob/8bfd062ca0f10c887167a8ecd9e6d975e083abe0/lib/utils.js#L32
and https://github.com/AdguardTeam/ExtendedCss/blob/8bfd062ca0f10c887167a8ecd9e6d975e083abe0/lib/utils.js#L210
There's a new way how you can get the browser brand in Chromium browsers:
navigator.userAgentData?.brands?.some(b => b.brand === 'Google Chrome')
But
navigator.userAgentData
is not available in Safari now, so need to fix theisSafariBrowser
function to check ifnavigator.userAgent
is available or not before call it.