Skip to content

Commit f5aa29f

Browse files
committed
Update README
Add details of resize and mobile behavior to the README. Note that the behaviour on height or width of 0 was pre-existing; I just documented it and added a spec.
1 parent 1d8ffc7 commit f5aa29f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Ferrum::Browser.new(options)
194194
* `:proxy` (Hash) - Specify proxy settings, [read more](https://github.com/rubycdp/ferrum#proxy)
195195
* `:save_path` (String) - Path to save attachments with [Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header.
196196
* `:env` (Hash) - Environment variables you'd like to pass through to the process
197-
197+
* `:mobile` (Boolean) - Specify whether to enable mobile emulation and touch UI.
198198

199199
## Navigation
200200

@@ -1088,6 +1088,13 @@ Overrides device screen dimensions and emulates viewport.
10881088
* :scale_factor `Float`, device scale factor. `0` by default
10891089
* :mobile `Boolean`, whether to emulate mobile device. `false` by default
10901090

1091+
Values of `0` for either `:width` or `:height` will be ignored; i.e., no viewport resize will take place.
1092+
1093+
If `:mobile` is `true`:
1094+
1095+
1. `:height` and `:width` will be ignored, and instead the viewport size of an iPhone 14 will be used (390 x 844).
1096+
2. Touch emulation will be enabled, with a maximum of 1 touch point.
1097+
10911098
```ruby
10921099
page.set_viewport(width: 1000, height: 600, scale_factor: 3)
10931100
```

0 commit comments

Comments
 (0)