Documentation
¶
Index ¶
- func InterpreterHash(source []byte) string
- type Challenge
- type Options
- type Profile
- type Runtime
- func (runtime *Runtime) Close()
- func (runtime *Runtime) FillPrompt(ctx context.Context, prompt string, submit bool) error
- func (runtime *Runtime) Proof(ctx context.Context, digest string, prompt string) (string, error)
- func (runtime *Runtime) RefreshSnapshot(ctx context.Context) (string, error)
- func (runtime *Runtime) Settle(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterpreterHash ¶
InterpreterHash 返回解释器源码的 SHA-256 base64url 摘要
Types ¶
type Challenge ¶
type Challenge struct {
MessageID string
InterpreterJavaScript string
InterpreterURL string
InterpreterHash string
Program string
GlobalName string
ClientExperimentsStateBlob string
}
Challenge 保存 Waa/Create 返回的客户端解释器输入
func ParseChallenge ¶
ParseChallenge 解析 Waa/Create 响应,第 2 字段的混淆 challenge 为空时读取第 1 字段的明文 challenge
type Options ¶
type Options struct {
Challenge Challenge
Interpreter string
Profile Profile
LoadImage func(string) bool
}
Options 定义一份 BotGuard VM 的解释器、宿主现场与网络依赖
type Profile ¶
type Profile struct {
PageURL string
Locale string
TimeZone string
Window map[string]any
Screen map[string]any
Document map[string]any
Globals map[string]any
LocalStorage map[string]string
HasFocus bool
// TrustedTypes 表示页面 CSP 要求脚本注入点使用 Trusted Types
TrustedTypes bool
NavigationStart time.Time
}
Profile 保存账户指纹与页面状态决定的宿主现场值
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime 在纯 Go JavaScript VM 中持有一份与官网页面同形态的 BotGuard 生命周期
func NewRuntime ¶
NewRuntime 在 Firefox 宿主中加载解释器并初始化 challenge program
func (*Runtime) FillPrompt ¶
FillPrompt 向页面提示词输入框写入文本并派发官网 Worker 相同的事件,submit 时点击 Run
func (*Runtime) RefreshSnapshot ¶
RefreshSnapshot 生成官网刷新 Waa/Create 时携带的无绑定 snapshot
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package goja 是 github.com/dop251/goja v0.0.0-20260826204918-8f1c0696a37b 的 MIT 分叉,增加多 Realm 共享微任务队列与 SpiderMonkey 错误消息和调用栈格式
|
Package goja 是 github.com/dop251/goja v0.0.0-20260826204918-8f1c0696a37b 的 MIT 分叉,增加多 Realm 共享微任务队列与 SpiderMonkey 错误消息和调用栈格式 |
|
ast
Package ast declares types representing a JavaScript AST.
|
Package ast declares types representing a JavaScript AST. |
|
file
Package file encapsulates the file abstractions used by the ast & parser.
|
Package file encapsulates the file abstractions used by the ast & parser. |
|
ftoa
Package ftoa provides ECMAScript-compliant floating point number conversion to string.
|
Package ftoa provides ECMAScript-compliant floating point number conversion to string. |
|
ftoa/internal/fast
Package fast contains code ported from V8 (https://github.com/v8/v8/blob/master/src/numbers/fast-dtoa.cc)
|
Package fast contains code ported from V8 (https://github.com/v8/v8/blob/master/src/numbers/fast-dtoa.cc) |
|
parser
Package parser implements a parser for JavaScript.
|
Package parser implements a parser for JavaScript. |
|
token
Package token defines constants representing the lexical tokens of JavaScript (ECMA5).
|
Package token defines constants representing the lexical tokens of JavaScript (ECMA5). |
|
unistring
Package unistring contains an implementation of a hybrid ASCII/UTF-16 string.
|
Package unistring contains an implementation of a hybrid ASCII/UTF-16 string. |