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:
- spawn the headless instance and do some preliminary setup (chrome-launcher + chrome-remote-interface);
- from another instance, navigate to chrome://inspect and inspect the tab;
- 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, and the website I need to interact with (a Guacamole RDP session) doesn't work properly on mobile as it relies heavily on mouse events. 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, something happens but the behaviour looks broken... I suspect that this is something concerning the DevTools frontend, and not the inspected Chrome instance.
In other words, 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.
Do you have any idea about how can I achieve this?
Best,
Andrea
PS I originally posted this message in the
chrome-debugging-protocol group, and I'm reposting here for visibility. I apologise for that, but I'm really stuck here...