Documentation
¶
Overview ¶
Package javascript implements the page-scoped Growse JavaScript Runtime.
Index ¶
- Constants
- type Runtime
- func (runtime *Runtime) DispatchHashChange(oldURL, newURL string)
- func (runtime *Runtime) DispatchMessage(event runtimemodel.MessageEvent) error
- func (runtime *Runtime) DispatchPageEvent(callback func() bool) bool
- func (runtime *Runtime) DispatchPopState(state string)
- func (runtime *Runtime) HasAnimationFrameCallbacks() bool
- func (runtime *Runtime) Load(ctx context.Context, scripts []runtimemodel.Script, ...) error
- func (runtime *Runtime) RunAnimationFrame(current time.Time) bool
- func (runtime *Runtime) SetBackground(background bool)
- func (runtime *Runtime) Start(ctx context.Context) error
- func (runtime *Runtime) Stop() error
- func (runtime *Runtime) UpdateFrames(frames []runtimemodel.FrameAccess)
- func (runtime *Runtime) UpdateLocation(documentURL *url.URL)
- func (runtime *Runtime) UpdateWindow(context runtimemodel.WindowContext)
Constants ¶
const (
MaxEventListeners = 10_000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is one JavaScript VM and serialized callback queue owned by a Page.
func (*Runtime) DispatchHashChange ¶
DispatchHashChange queues a same-document fragment event for JavaScript.
func (*Runtime) DispatchMessage ¶ added in v0.14.0
func (runtime *Runtime) DispatchMessage(event runtimemodel.MessageEvent) error
DispatchMessage adds one message event to the serialized Page queue.
func (*Runtime) DispatchPageEvent ¶
DispatchPageEvent serializes a browser Event with JavaScript callbacks.
func (*Runtime) DispatchPopState ¶
DispatchPopState queues a Browser history traversal event for JavaScript.
func (*Runtime) HasAnimationFrameCallbacks ¶
HasAnimationFrameCallbacks reports whether the Page requested another frame.
func (*Runtime) Load ¶
func (runtime *Runtime) Load(ctx context.Context, scripts []runtimemodel.Script, environment runtimemodel.Environment) error
Load prepares a VM and host objects without evaluating Page scripts.
func (*Runtime) RunAnimationFrame ¶
RunAnimationFrame synchronously delivers one browser frame on the Page queue.
func (*Runtime) SetBackground ¶
SetBackground applies hidden-Tab scheduling policy to the Page.
func (*Runtime) Start ¶
Start evaluates selected Page scripts according to classic script loading semantics and delivers the document lifecycle exactly once.
func (*Runtime) UpdateFrames ¶ added in v0.14.0
func (runtime *Runtime) UpdateFrames(frames []runtimemodel.FrameAccess)
UpdateFrames replaces direct child access on the serialized Page queue.
func (*Runtime) UpdateLocation ¶
UpdateLocation reflects a same-document Navigation in JavaScript location.
func (*Runtime) UpdateWindow ¶ added in v0.14.0
func (runtime *Runtime) UpdateWindow(context runtimemodel.WindowContext)
UpdateWindow refreshes parent, top, and child WindowProxy relationships.