Apply user agent client hints for pre-canned devices in the "Network conditions" tab

This change is to fetch userAgentMetadata and override navigator.userAgentData when user selects a pre-canned user agent from the network conditions tab.

Created 3 test scenarios to cover the userAgentMetadata values:
1) a device with userAgentMetadata and fixed userAgent value;
2) a device with userAgentMetadata and dynamic userAgent value where browser version is filled in dynamically;
3) a device without userAgentMetadata.

Bug: 1174299
Change-Id: If38cbb1f26784af890c86b7140b90899a6aa8504
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2832109
Commit-Queue: Guangyue Xu <guangyue.xu@microsoft.com>
Reviewed-by: Brandon Walderman <brwalder@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: John Emau <John.Emau@microsoft.com>
3 files changed
tree: 6bfc28905d066010565fee000935b76523183b6d
  1. build_overrides/
  2. config/
  3. docs/
  4. front_end/
  5. inspector_overlay/
  6. node_modules/
  7. scripts/
  8. test/
  9. third_party/
  10. v8/
  11. .clang-format
  12. .editorconfig
  13. .eslintignore
  14. .eslintrc.js
  15. .gitattributes
  16. .gitignore
  17. .gn
  18. .npmignore
  19. .npmrc
  20. .style.yapf
  21. .stylelintignore
  22. .stylelintrc.json
  23. ARCHITECTURE.md
  24. AUTHORS
  25. BUILD.gn
  26. DEPS
  27. LICENSE
  28. OWNERS
  29. package-lock.json
  30. package.json
  31. PRESUBMIT.py
  32. README.md
  33. tsconfig.base.json
  34. tsconfig.json
  35. WATCHLISTS
README.md

Chrome DevTools frontend

npm package

The client-side of the Chrome DevTools, including all JS & CSS to run the DevTools webapp.

Source code

The frontend is available on chromium.googlesource.com.

Design guidelines

Please be aware that DevTools follows additional development guidelines.

Issue triage

The issue triage guidelines can be found in docs/triage_guidelines.md.

Workflows

Instructions to set up, use, and maintain a DevTools frontend checkout can be found in docs/workflows.md.

Additional references

Source mirrors

DevTools frontend repository is mirrored on GitHub.

DevTools frontend is also available on NPM as the chrome-devtools-frontend package. It's not currently available via CJS or ES modules, so consuming this package in other tools may require some effort.

The version number of the npm package (e.g. 1.0.373466) refers to the Chromium commit position of latest frontend git commit. It's incremented with every Chromium commit, however the package is updated roughly daily.

Getting in touch