File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 786786 return new UAParser ( ua , extensions ) . getResult ( ) ;
787787 }
788788
789- var _ua = ua || ( ( typeof window !== UNDEF_TYPE && window . navigator && window . navigator . userAgent ) ? window . navigator . userAgent : EMPTY ) ;
790- var _uach = ( typeof window !== UNDEF_TYPE && window . navigator && window . navigator . userAgentData ) ? window . navigator . userAgentData : undefined ;
789+ var _navigator = ( typeof window !== UNDEF_TYPE && window . navigator ) ? window . navigator : undefined ;
790+ var _ua = ua || ( ( _navigator && _navigator . userAgent ) ? _navigator . userAgent : EMPTY ) ;
791+ var _uach = ( _navigator && _navigator . userAgentData ) ? _navigator . userAgentData : undefined ;
791792 var _rgxmap = extensions ? extend ( regexes , extensions ) : regexes ;
792793
793794 this . getBrowser = function ( ) {
794795 var _browser = { } ;
795796 _browser [ NAME ] = undefined ;
796797 _browser [ VERSION ] = undefined ;
797798 rgxMapper . call ( _browser , _ua , _rgxmap . browser ) ;
798- _browser . major = majorize ( _browser . version ) ;
799+ _browser [ MAJOR ] = majorize ( _browser [ VERSION ] ) ;
800+ // Brave-specific detection
801+ if ( _navigator && _navigator . brave && typeof _navigator . brave . isBrave == FUNC_TYPE ) {
802+ _browser [ NAME ] = 'Brave' ;
803+ }
799804 return _browser ;
800805 } ;
801806 this . getCPU = function ( ) {
You can’t perform that action at this time.
0 commit comments