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

2k views Asked by At

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.

2

There are 2 answers

0
cYrus On BEST ANSWER

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

Touch vs mouse switch

6
Matthew M. On

If I understand you correctly, you want to do manual interactions with a remote instance using a desktop device. You should just be able to click the device icon at the top left of your devtools window to turn off mobile.

DevTools Device Toggle