Documentation ¶
Index ¶
- Variables
- func Close()
- func FailWithReason(page *rod.Page, e *proto.FetchRequestPaused) error
- func Init(options *types.Options) error
- func InitHeadless(localFileAccess bool, np *networkpolicy.NetworkPolicy)
- func IsHostAllowed(targetUrl string) bool
- func IsLFAAllowed() 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 ¶
var ( ErrURLDenied = errorutil.NewWithFmt("headless: url %v dropped by rule: %v") ErrHostDenied = errorutil.NewWithFmt("host %v dropped by network policy") NetworkPolicy *networkpolicy.NetworkPolicy )
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 ¶
func InitHeadless(localFileAccess bool, np *networkpolicy.NetworkPolicy)
InitHeadless initializes headless protocol state
func IsHostAllowed ¶
IsHostAllowed checks if the host is allowed by network policy
func IsLFAAllowed ¶ added in v3.1.4
func IsLFAAllowed() bool
IsLFAAllowed returns true if local file access is allowed
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.