ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Expose API to enable mobile emulation mode

Open d4rky-pl opened this issue 5 years ago • 5 comments

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.

d4rky-pl avatar Jul 14 '20 14:07 d4rky-pl

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.

alagos avatar Jan 15 '21 09:01 alagos