ferrum
ferrum copied to clipboard
Expose API to enable mobile emulation mode
From what I see in the library there's only one call to setDeviceMetricsOverride that sets mobile: false.
It would be great if there was an exposed API to enable mobile emulation and manage width and height of the viewport dynamically.
FWIW, I've added a mobile user agent to emulate it:
agent = 'Mozilla/5.0 (Linux; Android 7.0.0; Pixel Build/Unknown;) AppleWebKit/537.36.0 (KHTML, like Gecko) Chrome/60.0.0.0 Mobile Safari/537.36.0'
browser.headers.set("User-Agent" => agent)
Probably isn't the same, but it worked for me.