Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard deprecated platform property #248

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

akito19
Copy link
Member

@akito19 akito19 commented May 25, 2023

I propose to introduce a property to guard td_platform value.
Currently, td_platform is based on window.navigator.platform. However, this property is not recommended now:

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform

So that I want to introduce a platform property of NavigatorUAData: window.navigator.userAgentData.platform.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform

This property changes a value "MacIntel" (M1, M2 Mac is recognized as "MacIntel"!) to "macOS", for example.
However, existing behavior is prioritized because the window.navigator.userAgentData.platform has been experimental yet and browser compatibility is so restricted.

What do you think about it?

@akito19 akito19 requested a review from a team as a code owner May 25, 2023 13:31
@imnutz
Copy link
Collaborator

imnutz commented May 26, 2023

@akito19 It looks good to me. I'll plan to have this in the next version. Thank you for the pr

Copy link
Collaborator

@imnutz imnutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imnutz imnutz requested a review from a team September 7, 2023 03:09
Copy link

@nmpennypacker nmpennypacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed for data exfiltrations

@imnutz imnutz merged commit ede36c0 into master Sep 19, 2023
3 checks passed
@akito19 akito19 deleted the fallback-deprecated-property branch September 26, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants