Search code examples
google-chromegoogle-chrome-devtoolschrome-remote-debugging

How to set the device type (to not mobile) when inspecting a remote target with Chrome DevTools?


So it seems that the device toolbar usually present in any regular DevTools instance is missing when inspecting a remote instance.

device toolbar

And in such cases the device type is set to "Mobile", with the mouse pointer set to a circle, as to indicate that.

Here's how to reproduce this:

  1. start a new headless instance, e.g., with:

    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --headless https://example.com
    
  2. using another Chrome instance navigate to chrome://inspect and inspect the remote tab.

  3. as you can see there is no device toolbar.

devtools

I also tried to send some Chrome DevTools Protocol commands like:

But to no avail, something happens but the behavior looks broken... I suspect that this is something concerning the DevTools frontend, and not the inspected Chrome instance.

Do you have any idea about how can I work around this? My ultimate goal is to manually interact with a remote headless instance using a desktop device type.


Solution

  • Not sure since when, but in version 121.0.6167.139 a new switch appeared.

    Touch vs mouse switch