Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose os.Process from the Browser #737

Merged
merged 7 commits into from Apr 30, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions browser.go
Expand Up @@ -310,6 +310,15 @@ func (b *Browser) run(ctx context.Context) {
}
}

// Process returns the Chrome process object
ZekeLu marked this conversation as resolved.
Show resolved Hide resolved
// Example:
// if process := chromedp.FromContext(ctx).Browser.Process(); process != nil {
// fmt.Printf("Chrome PID: %v", process.Pid)
ZekeLu marked this conversation as resolved.
Show resolved Hide resolved
// }
ZekeLu marked this conversation as resolved.
Show resolved Hide resolved
func (b *Browser) Process() *os.Process {
ZekeLu marked this conversation as resolved.
Show resolved Hide resolved
return b.process
}

// BrowserOption is a browser option.
type BrowserOption = func(*Browser)

Expand Down