web

package
v0.0.0-...-6389cdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GetLinks = `` /* 2959-byte string literal not displayed */

Variables

This section is empty.

Functions

func AnalyzeGatheredEvents

func AnalyzeGatheredEvents(history *db.History, events []PageEvent)

func AutoFillForm

func AutoFillForm(form *rod.Element, page *rod.Page)

func AutoFillInput

func AutoFillInput(input *rod.Element, page *rod.Page)

func AutoFillTextarea

func AutoFillTextarea(textarea *rod.Element, page *rod.Page)

func GetAndClickButtons

func GetAndClickButtons(p *rod.Page)

func GetAndSubmitForms

func GetAndSubmitForms(p *rod.Page) (err error)

GetForms : Given a page, returns its forms

func GetBackgroundServiceCallbacks

func GetBackgroundServiceCallbacks() (callbacks []interface{})

func GetBrowserDatabaseCallbacks

func GetBrowserDatabaseCallbacks() (callbacks []interface{})

func GetDOMStorageCallbacks

func GetDOMStorageCallbacks() (callbacks []interface{})

func GetIndexedDBCallbacks

func GetIndexedDBCallbacks() (callbacks []interface{})

func GetPageAnchors

func GetPageAnchors(p *rod.Page) (anchors []string, err error)

GetPageAnchors find anchors on the given page

func GetPageResources

func GetPageResources(p *rod.Page) ([]byte, error)

GetPageResources gets all the page loaded resources, not used by now and probably can be removed as all requests are already hijacked

func IgnoreCertificateErrors

func IgnoreCertificateErrors(p *rod.Page)

IgnoreCertificateErrors tells the browser to ignore certificate errors

func InteractWithPage

func InteractWithPage(p *rod.Page)

func ListenForPageEvents

func ListenForPageEvents(ctx context.Context, url string, page *rod.Page, workspaceID, taskID uint, source string) <-chan PageEvent

func ListenForWebSocketEvents

func ListenForWebSocketEvents(page *rod.Page, workspaceID, taskID uint, source string)

func RunOnPage

func RunOnPage(page *rod.Page)

func SubmitForm

func SubmitForm(form *rod.Element, page *rod.Page)

Types

type BrowserEventsHandler

type BrowserEventsHandler struct {
	ListenBackgroundServiceEvents bool
	ListenIndexedDBEvents         bool
	ListenDOMStorageEvents        bool
}

func (*BrowserEventsHandler) GetCallbacks

func (h *BrowserEventsHandler) GetCallbacks() (callbacks []interface{})

func (*BrowserEventsHandler) RunOnBrowser

func (h *BrowserEventsHandler) RunOnBrowser(browser *rod.Browser)

type Button

type Button struct {
	// contains filtered or unexported fields
}

Button : Represents an HTML button

type EventCategory

type EventCategory string
const (
	DOM          EventCategory = "DOM"
	DOMStorage   EventCategory = "DOMStorage"
	NetworkAuth  EventCategory = "NetworkAuth"
	Debugger     EventCategory = "Debugger"
	Security     EventCategory = "Security"
	Runtime      EventCategory = "Runtime"
	Services     EventCategory = "Services"
	IndexedDB    EventCategory = "IndexedDB"
	CacheStorage EventCategory = "CacheStorage"
	Database     EventCategory = "Database"
	Audits       EventCategory = "Audits"
	Console      EventCategory = "Console"
	Certificate  EventCategory = "Certificate"
)

func (EventCategory) ReportEvents

func (c EventCategory) ReportEvents(history *db.History, events []PageEvent)

type Form

type Form struct {
	// contains filtered or unexported fields
}

Form : Represents an HTML form

type Iframe

type Iframe struct {
	// contains filtered or unexported fields
}

Iframe : Represents an Iframe included in a page

type InputNameValue

type InputNameValue struct {
	Name  string
	Value string
}

type InputTypeValue

type InputTypeValue struct {
	Type  string
	Value string
}

type PageDOMAudit

type PageDOMAudit struct {
	URL      string
	Page     *rod.Page
	MaxDepth int
	// Pierce (optional) Whether or not iframes and shadow roots should be traversed when returning the subtree
	// (default is false). Reports listeners for all contexts if pierce is enabled.
	Pierce bool
}

func (*PageDOMAudit) EvaluateCookiesUsageInDOM

func (a *PageDOMAudit) EvaluateCookiesUsageInDOM()

func (*PageDOMAudit) InspectDOMNode

func (a *PageDOMAudit) InspectDOMNode(node *proto.DOMNode)

func (*PageDOMAudit) InspectDOMNodes

func (a *PageDOMAudit) InspectDOMNodes(nodes []*proto.DOMNode)

func (*PageDOMAudit) Run

func (a *PageDOMAudit) Run()

type PageEvent

type PageEvent struct {
	Type        PageEventType
	URL         string
	Description string
	Data        map[string]interface{}
	Issue       db.Issue
}

type PageEventType

type PageEventType string
const (
	JavaScriptDialogOpening          PageEventType = "PageJavascriptDialogOpening"
	BackgroundServiceEventReceived   PageEventType = "BackgroundServiceBackgroundServiceEventReceived"
	StorageIndexedDBContentUpdated   PageEventType = "StorageIndexedDBContentUpdated"
	StorageCacheStorageListUpdated   PageEventType = "StorageCacheStorageListUpdated"
	StorageIndexedDBListUpdated      PageEventType = "StorageIndexedDBListUpdated"
	DatabaseAddDatabase              PageEventType = "DatabaseAddDatabase"
	DebuggerScriptParsed             PageEventType = "DebuggerScriptParsed"
	AuditsIssueAdded                 PageEventType = "AuditsIssueAdded"
	SecuritySecurityStateChanged     PageEventType = "SecuritySecurityStateChanged"
	SecurityHandleCertificateError   PageEventType = "SecurityHandleCertificateError"
	DOMStorageDomStorageItemAdded    PageEventType = "DOMStorageDomStorageItemAdded"
	DOMStorageDomStorageItemRemoved  PageEventType = "DOMStorageDomStorageItemRemoved"
	DOMStorageDomStorageItemsCleared PageEventType = "DOMStorageDomStorageItemsCleared"
	DOMStorageDomStorageItemUpdated  PageEventType = "DOMStorageDomStorageItemUpdated"
	SecurityCertificateError         PageEventType = "SecurityCertificateError"
	NetworkAuthChallenge             PageEventType = "NetworkAuthChallenge"
	RuntimeConsoleAPICalled          PageEventType = "RuntimeConsoleAPICalled"
)

type WebPage

type WebPage struct {
	URL             string
	ResponseURL     string
	RemoteIPAddress string
	Port            int
	Headers         map[string]string
	StatusCode      int
	MimeType        string
	Body            string
	Anchors         []string
	Forms           []Form
	Buttons         []Button
	Iframes         []Iframe
	Cookies         []cookies.Cookie
	Issues          []db.Issue
	SecurityState   string
	SecurityDetails *proto.NetworkSecurityDetails
}

func (*WebPage) HasParameters

func (wp *WebPage) HasParameters() (bool, error)

HasParameters checks if a web page has parameters

func (*WebPage) LogPageData

func (wp *WebPage) LogPageData()

LogPageData logs web page data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL