changed browser api to return pages that can be acted on, not strictly contents
This commit is contained in:
17
browser.go
17
browser.go
@@ -5,23 +5,8 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
type ScreenshotStyle string
|
||||
|
||||
const (
|
||||
ScreenshotStyleFullPage ScreenshotStyle = "full"
|
||||
ScreenshotStyleViewport ScreenshotStyle = "viewport"
|
||||
)
|
||||
|
||||
type ScreenshotOptions struct {
|
||||
Style ScreenshotStyle
|
||||
Width int
|
||||
Height int
|
||||
}
|
||||
|
||||
type Browser interface {
|
||||
io.Closer
|
||||
|
||||
Open(ctx context.Context, url string) (Source, error)
|
||||
Screenshot(ctx context.Context, url string, opts ScreenshotOptions) ([]byte, error)
|
||||
OpenAndScreenshot(ctx context.Context, url string, opts ScreenshotOptions) (Source, []byte, error)
|
||||
Open(ctx context.Context, url string) (Document, error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user