Merge pull request #10956 from pmulholland42/master

Add undefined check for navigator.userAgent
This commit is contained in:
Andreas Hocevar
2020-04-24 00:33:43 +02:00
committed by GitHub

View File

@@ -3,7 +3,9 @@
*/
const ua =
typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : '';
typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined'
? navigator.userAgent.toLowerCase()
: '';
/**
* User agent string says we are dealing with Firefox as browser.