Documentation ¶
Index ¶
- Constants
- Variables
- type Bounds
- type Browser
- func (_this *Browser) Bind(name string, f interface{}) error
- func (_this *Browser) Bounds() (Bounds, error)
- func (_this *Browser) BrowserClearBrowserCache() error
- func (_this *Browser) BrowserClearBrowserCookies() error
- func (_this *Browser) BrowserClose() error
- func (_this *Browser) BrowserGetVersion() (Version, error)
- func (_this *Browser) Close() error
- func (_this *Browser) Done() <-chan struct{}
- func (_this *Browser) Eval(js string) Value
- func (_this *Browser) PageBringToFront() error
- func (_this *Browser) PageCaptureScreenshot(Parameters PageCaptureScreenshotParameters) (string, error)
- func (_this *Browser) PageNavigate(url string) error
- func (_this *Browser) PagePrintToPDF(Parameters PrintToPDFParameters) (string, error)
- func (_this *Browser) PageReload() error
- func (_this *Browser) PageResetNavigationHistory() error
- func (_this *Browser) PageStopLoading() error
- func (_this *Browser) Run(conf ...Config) error
- func (_this *Browser) RuntimeEvaluate(Parameters RuntimeEvaluateParameters) (json.RawMessage, error)
- func (_this *Browser) SetBounds(b Bounds) error
- type Config
- type PageCaptureScreenshotParameters
- type PageReloadParameters
- type PrintToPDFParameters
- type RuntimeEvaluateParameters
- type ScreenshotFormat
- type Value
- type Version
- type Viewport
- type WindowState
Constants ¶
const ( Chrome flavor = 1 Edge flavor = 2 )
Variables ¶
var DefaultBrowserArgs = []string{
"--disable-background-networking",
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-breakpad",
"--disable-client-side-phishing-detection",
"--disable-default-apps",
"--disable-dev-shm-usage",
"--disable-infobars",
"--disable-extensions",
"--disable-features=site-per-process",
"--disable-hang-monitor",
"--disable-ipc-flooding-protection",
"--disable-popup-blocking",
"--disable-prompt-on-repost",
"--disable-renderer-backgrounding",
"--disable-sync",
"--disable-translate",
"--metrics-recording-only",
"--no-first-run",
"--safebrowsing-disable-auto-update",
"--enable-automation",
"--password-store=basic",
"--use-mock-keychain",
"--disable-dinosaur-easter-egg",
"--disable-windows10-custom-titlebar",
"--no-default-browser-check",
}
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
type Bounds struct { Left int `json:"left"` Top int `json:"top"` Width int `json:"width"` Height int `json:"height"` WindowState WindowState `json:"windowState"` }
Bounds defines settable window properties.
type Browser ¶
func (*Browser) BrowserClearBrowserCache ¶ added in v1.0.2
BrowserClearBrowserCache Clears browser cache.
func (*Browser) BrowserClearBrowserCookies ¶ added in v1.0.2
BrowserClearBrowserCookies Clears browser cookies.
func (*Browser) BrowserClose ¶ added in v1.0.2
BrowserClose Close browser gracefully.
func (*Browser) BrowserGetVersion ¶ added in v1.0.2
BrowserGetVersion Returns version information.
func (*Browser) PageBringToFront ¶ added in v1.0.2
PageBringToFront Brings page to front (activates tab).
func (*Browser) PageCaptureScreenshot ¶ added in v1.0.2
func (_this *Browser) PageCaptureScreenshot(Parameters PageCaptureScreenshotParameters) (string, error)
PageCaptureScreenshot Capture page screenshot
func (*Browser) PageNavigate ¶ added in v1.0.2
PageNavigate Navigates current page to the given URL.
func (*Browser) PagePrintToPDF ¶ added in v1.0.2
func (_this *Browser) PagePrintToPDF(Parameters PrintToPDFParameters) (string, error)
PagePrintToPDF Print page as PDF.
func (*Browser) PageReload ¶ added in v1.0.2
PageReload Reloads given page optionally ignoring the cache.
func (*Browser) PageResetNavigationHistory ¶ added in v1.0.2
PageResetNavigationHistory Resets navigation history for the current page.
func (*Browser) PageStopLoading ¶ added in v1.0.2
PageStopLoading Force the page stop all navigations and pending resource fetches.
func (*Browser) RuntimeEvaluate ¶ added in v1.0.3
func (_this *Browser) RuntimeEvaluate(Parameters RuntimeEvaluateParameters) (json.RawMessage, error)
RuntimeEvaluate Evaluates expression on global object.
type PageCaptureScreenshotParameters ¶ added in v1.0.2
type PageCaptureScreenshotParameters struct { Format *ScreenshotFormat `json:"format"` Quality *int `json:"quality"` Clip *Viewport `json:"clip"` }
type PageReloadParameters ¶ added in v1.0.2
type PrintToPDFParameters ¶ added in v1.0.2
type PrintToPDFParameters struct { Landscape *bool `json:"landscape"` PrintBackground *bool `json:"printBackground"` Scale *int `json:"scale"` PaperWidth *int `json:"paperWidth"` PaperHeight *int `json:"paperHeight"` MarginTop *int `json:"marginTop"` MarginBottom *int `json:"marginBottom"` MarginLeft *int `json:"marginLeft"` MarginRight *int `json:"marginRight"` PageRanges *string `json:"pageRanges"` IgnoreInvalidPageRanges *bool `json:"ignoreInvalidPageRanges"` HeaderTemplate *string `json:"headerTemplate"` PreferCSSPageSize *bool `json:"preferCSSPageSize"` }
type RuntimeEvaluateParameters ¶ added in v1.0.3
type RuntimeEvaluateParameters struct { Expression string `json:"expression"` ObjectGroup *string `json:"objectGroup"` IncludeCommandLineAPI *bool `json:"includeCommandLineAPI"` Silent *bool `json:"silent"` ContextId *int `json:"contextId"` ReturnByValue *bool `json:"returnByValue"` GeneratePreview *bool `json:"generatePreview"` UserGesture *bool `json:"userGesture"` AwaitPromise *bool `json:"awaitPromise"` ThrowOnSideEffect *bool `json:"throwOnSideEffect"` Timeout *int `json:"timeout"` DisableBreaks *bool `json:"disableBreaks"` }
type ScreenshotFormat ¶
type ScreenshotFormat string
const ( JPEG ScreenshotFormat = "jpeg" PNG ScreenshotFormat = "png" )
func (ScreenshotFormat) Pointer ¶
func (_this ScreenshotFormat) Pointer() *ScreenshotFormat
type Value ¶
type Value interface { Err() error To(interface{}) error Float() float32 Int() int String() string Bool() bool Object() map[string]Value Array() []Value Bytes() []byte }
Value is a generic type of a JSON value (primitive, object, array) and optionally an error value.
type WindowState ¶
type WindowState string
WindowState defines the state of the Chrome window, possible values are "normal", "maximized", "minimized" and "fullscreen".
const ( // WindowStateNormal defines a normal state of the browser window WindowStateNormal WindowState = "normal" // WindowStateMaximized defines a maximized state of the browser window WindowStateMaximized WindowState = "maximized" // WindowStateMinimized defines a minimized state of the browser window WindowStateMinimized WindowState = "minimized" // WindowStateFullscreen defines a fullscreen state of the browser window WindowStateFullscreen WindowState = "fullscreen" )