Skip to content

feat(Platform): allow DI override of userAgent #33751

Description

@waterplea

Feature Description

Right now it is hardcoded as global navigator.userAgent:
https://github.com/angular/components/blob/main/src/cdk/platform/platform.ts

However in SSR there's a way to get userAgent from the request and accessing global entities is bad practice. Would be great if there was a token for userAgent like we do here, or maybe at least inject(DOCUMENT).defaultView?.navigator?.userAgent way of accessing it, rather than just global navigator.userAgent

Use Case

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cdk/platformfeatureLabel used to distinguish feature request from other issuesgemini-triagedLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions