Skip to content

Commit

Permalink
Guard deprecated platform property (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
akito19 committed Sep 19, 2023
1 parent bf14dae commit ede36c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/plugins/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function configureValues (track) {
return [userAgent, sdkUserAgent].join(';')
},
td_platform: function () {
return window.navigator.platform
// navigator.platform is recommended to using another way because of deprecated.
// Use navigator.userAgentData.platform instead.
return window.navigator.platform || window.navigator.userAgentData.platform
},
td_host: function () {
return document.location.host
Expand Down

0 comments on commit ede36c0

Please sign in to comment.