Search code examples
google-chromegoogle-chrome-devtoolschrome-dev-editor

how user agent in network conditions tab works


This is the screenshot of network conditions tab in google chrome. It allows you to set browser specs.

enter image description here

I am wondering, how is this done? It surely doesn't change navigator object directly, since it is read-only.


Solution

  • It uses the setUserAgentOverride method of the debugging protocol. Chrome then handles that value internally.