How to set the device type?

70 views
Skip to first unread message

Andrea Cardaci

unread,
Apr 22, 2022, 8:55:31 AM4/22/22
to chrome-debugging-protocol
Hi there,

I'm in a situation where I need to use DevTools to interact with a remote headless Chrome instance. The workflow is the following:

  1. spawn the headless instance and do some preliminary setup (chrome-launcher + chrome-remote-interface);
  2. from another instance, navigate to chrome://inspect and inspect the tab;
  3. a window pops up where, on the left-hand side there is the screencast, and on the right-hand side there is DevTools.
The problem is that Chrome is treating the remote instance as a mobile device, in particular it show the circle pointer. The question is, how can I use it as desktop device? The usual DevTools toolbar with the dropdown menu containing Desktop, Mobile, etc. is not present in this setup.

I even tried executing some CDP methods like Emulation.setTouchEmulationEnabled and Emulation.setDeviceMetricsOverride, but with no luck.

Do you have any idea about how can I achieve this?


Best,
Andrea

Andrea Cardaci

unread,
Apr 24, 2022, 8:45:59 AM4/24/22
to chrome-debugging-protocol
I guess that another way to describe this problem is: how can I set the device type to be "Desktop" (instead of "Mobile") in devtools://devtools/bundled/inspector.html?ws=[...]? There is no device toolbar there.
Reply all
Reply to author
Forward
0 new messages