Skip to content

Commit 194755c

Browse files
committed
document Browser#reset
1 parent 3a2dc27 commit 194755c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Web design by [Evrone](https://evrone.com/), what else
4040
* [Navigation](https://github.com/rubycdp/ferrum#navigation)
4141
* [Finders](https://github.com/rubycdp/ferrum#finders)
4242
* [Screenshots](https://github.com/rubycdp/ferrum#screenshots)
43+
* [Cleaning Up](https://github.com/rubycdp/ferrum#cleaning-up)
4344
* [Network](https://github.com/rubycdp/ferrum#network)
4445
* [Mouse](https://github.com/rubycdp/ferrum#mouse)
4546
* [Keyboard](https://github.com/rubycdp/ferrum#keyboard)
@@ -407,6 +408,25 @@ browser.mhtml(path: "google.mhtml") # => 87742
407408
```
408409

409410

411+
## Cleaning Up
412+
413+
#### reset
414+
415+
Closes browser tabs opened by the `Browser` instance.
416+
417+
```ruby
418+
# connect to a long-running Chrome process
419+
browser = Ferrum::Browser.new(url: 'http://localhost:9222')
420+
421+
browser.go_to("https://github.com/")
422+
423+
# clean up, lest the tab stays there hanging forever
424+
browser.reset
425+
426+
browser.quit
427+
```
428+
429+
410430
## Network
411431

412432
browser.network

0 commit comments

Comments
 (0)