'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 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matthew M.