scripts

package
v0.13.34 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package scripts provides embedded JavaScript for the DevTool proxy instrumentation.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the agnt version to inject into scripts. Set this before calling GetCombinedScript() for the first time.

Functions

func GetAxeCore added in v0.12.8

func GetAxeCore() string

GetAxeCore returns the bundled axe-core JavaScript library.

func GetCombinedScript

func GetCombinedScript() string

GetCombinedScript returns all JavaScript modules combined into a single script. The script is wrapped in appropriate tags and ordered for correct initialization. The result is cached after first call. Equivalent to GetCombinedScriptForRole(RoleFull).

func GetCombinedScriptForRole added in v0.13.31

func GetCombinedScriptForRole(role Role) string

GetCombinedScriptForRole returns the bundle flavour for the given frame role (RoleFull, RoleChrome, or RoleContent), built once and cached.

func GetScriptNames

func GetScriptNames() []string

GetScriptNames returns the list of embedded script names for debugging.

Types

type Role added in v0.13.31

type Role string

Role identifies which per-frame bundle flavour to build. The proxy knows the frame role at injection time: the chrome-shell document is generated by BuildShellDocument (chrome), a wrapped content frame's request carries the frame marker (content), and everything else — unwrapped fallback, HTML fragments, passive embeds, legacy injection — gets the full bundle, which is byte-for-byte today's behaviour.

const (
	// RoleFull is the complete bundle: every module (passive/legacy default).
	RoleFull Role = ""
	// RoleChrome is the shell bundle: shared + chrome-only modules, without
	// the content-only set.
	RoleChrome Role = "chrome"
	// RoleContent is the content-frame bundle: shared modules (including the
	// indicator-bridge / walkthrough-proxy forwarding stubs) + content-only
	// modules, without the chrome-only set.
	RoleContent Role = "content"
)

Jump to

Keyboard shortcuts

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