Documentation ¶
Index ¶
- Variables
- func Close()
- func FailWithReason(page *rod.Page, e *proto.FetchRequestPaused) error
- func Init(options *types.Options) error
- func InitHeadless(RestrictLocalNetworkAccess bool, localFileAccess bool)
- func IsHostAllowed(targetUrl string) bool
- func NewJSRuntime() *goja.Runtime
- func NormalizePath(filePath string) (string, error)
- func ValidateNFailRequest(page *rod.Page, e *proto.FetchRequestPaused) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrURLDenied = errorutil.NewWithFmt("headless: url %v dropped by rule: %v") ErrHostDenied = errorutil.NewWithFmt("host %v dropped by network policy") )
View Source
var Dialer *fastdialer.Dialer
Dialer is a shared fastdialer instance for host DNS resolution
Functions ¶
func FailWithReason ¶
func FailWithReason(page *rod.Page, e *proto.FetchRequestPaused) error
FailWithReason fails request with AccessDenied reason
func InitHeadless ¶
InitHeadless initializes headless protocol state
func IsHostAllowed ¶
IsHostAllowed checks if the host is allowed by network policy
func NewJSRuntime ¶
NewJSRuntime returns a new javascript runtime with defaults set i.e sourcemap parsing is disabled by default
func NormalizePath ¶
Normalizepath normalizes path and returns absolute path it returns error if path is not allowed this respects the sandbox rules and only loads files from allowed directories
func ValidateNFailRequest ¶
func ValidateNFailRequest(page *rod.Page, e *proto.FetchRequestPaused) error
ValidateNFailRequest validates and fails request if the request does not respect the rules, it will be canceled with reason
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.