Skip to content

Commit

Permalink
bugfix: fix window.navigator.userAgentData may be '{}' (#8474)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtang authored Oct 24, 2023
1 parent f7b1e3d commit d535e16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/utils/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const TOUCH_ENABLED = Boolean(Dom.isReal() && (

const UAD = window.navigator && window.navigator.userAgentData;

if (UAD) {
if (UAD && UAD.platform && UAD.brands) {
// If userAgentData is present, use it instead of userAgent to avoid warnings
// Currently only implemented on Chromium
// userAgentData does not expose Android version, so ANDROID_VERSION remains `null`
Expand Down

0 comments on commit d535e16

Please sign in to comment.