overlord

package
v1.5.34 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllURLs - All URLs permission
	AllURLs = "<all_urls>"

	// AllHTTP - All HTTP permission
	AllHTTP = "http://*/*"

	// AllHTTPS - All HTTP permission
	AllHTTPS = "https://*/*"

	// WebRequest - WebRequest permission
	WebRequest = "webRequest"

	// WebRequestBlocking - WebRequestBlocking permission
	WebRequestBlocking = "webRequestBlocking"

	// FetchManifestJS - Get extension manifest
	FetchManifestJS = "(() => { return chrome.runtime.getManifest(); })()"
)

Variables

View Source
var (
	// ErrTargetNotFound - Returned when a target cannot be found
	ErrTargetNotFound = errors.New("target not found")
)

Functions

func DumpCookies

func DumpCookies(curse *core.CursedProcess, webSocketURL string) ([]*network.Cookie, error)

DumpCookies - Dump all cookies from the remote debug target

func ExecuteJS

func ExecuteJS(ctx context.Context, string, targetID string, jsCode string) ([]byte, error)

ExecuteJS - injects a JavaScript code into a target

func GetChromeContext

func GetChromeContext(webSocketURL string, curse *core.CursedProcess) (context.Context, context.CancelFunc, context.CancelFunc)

func Screenshot

func Screenshot(curse *core.CursedProcess, webSocketURL string, targetID string, quality int64) ([]byte, error)

Screenshot - Take a screenshot of a Chrome context

func SetCookie

func SetCookie(curse *core.CursedProcess, webSocketURL string, host string, cookies ...string) (string, error)

Types

type ChromeDebugTarget

type ChromeDebugTarget struct {
	Description          string `json:"description"`
	DevToolsFrontendURL  string `json:"devtoolsFrontendUrl"`
	ID                   string `json:"id"`
	Title                string `json:"title"`
	Type                 string `json:"type"`
	URL                  string `json:"url"`
	WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
}

ChromeDebugTarget - A single debug context object

func FindExtensionWithPermissions

func FindExtensionWithPermissions(curse *core.CursedProcess, permissions []string) (*ChromeDebugTarget, error)

FindExtensionWithPermissions - Find an extension with a permission

func FindExtensionsWithPermissions

func FindExtensionsWithPermissions(curse *core.CursedProcess, permissions []string) ([]*ChromeDebugTarget, error)

FindExtensionsWithPermissions - Find an extension with a permission

func QueryDebugTargets

func QueryDebugTargets(debugURL string) ([]ChromeDebugTarget, error)

QueryDebugTargets - Query debug listener using HTTP client

func QueryExtensionDebugTargets

func QueryExtensionDebugTargets(debugURL string) ([]ChromeDebugTarget, error)

QueryExtensionDebugTargets - Query debug listener using HTTP client for Extensions only

type Manifest

type Manifest struct {
	Name            string             `json:"name"`
	Version         string             `json:"version"`
	Description     string             `json:"description"`
	ManifestVersion int                `json:"manifest_version"`
	Permissions     []string           `json:"permissions"`
	Background      ManifestBackground `json:"background"`
}

Manifest - An extension manifest file

type ManifestBackground

type ManifestBackground struct {
	Scripts    []string `json:"scripts"`
	Persistent bool     `json:"persistent"`
}

ManifestBackground - An extension manifest file

Jump to

Keyboard shortcuts

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