Skip to content

Commit

Permalink
add example for piping browser cli output
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Aug 5, 2021
1 parent 4002b9c commit ab8740f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/launcher/example_test.go
@@ -1,6 +1,7 @@
package launcher_test

import (
"os"
"os/exec"

"github.com/go-rod/rod"
Expand All @@ -16,6 +17,12 @@ func Example_use_system_browser() {
}
}

func Example_print_browser_CLI_output() {
// Pipe the browser stderr and stdout to os.Stdout .
u := launcher.New().Logger(os.Stdout).MustLaunch()
rod.New().ControlURL(u).MustConnect()
}

func Example_custom_launch() {
// get the browser executable path
path := launcher.NewBrowser().MustGet()
Expand Down

0 comments on commit ab8740f

Please sign in to comment.