The problem lies in the if condition that checks firefoxVersion <= 58. If isFirefox is null, meaning the user agent does not match Firefox, then firefoxVersion will be set to null, and the condition null <= 58 will always be false, causing the function to return false even for non-Firefox browsers.
The bug has been resolved by adding a check for both firefoxVersion !== null && firefoxVersion <= 58.
The problem lies in the if condition that checks
firefoxVersion <= 58
. If isFirefox isnull
, meaning the user agent does not match Firefox, thenfirefoxVersion
will be set tonull
, and the conditionnull <= 58
will always be false, causing the function to return false even for non-Firefox browsers.The bug has been resolved by adding a check for both
firefoxVersion !== null && firefoxVersion <= 58
.