Documentation
¶
Overview ¶
Package scripts provides embedded JavaScript for the DevTool proxy instrumentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
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" )