yaegi

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package yaegi はYaegiを使ったGrowseページのRuntimeを実装する。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime は1ページ専用のYaegiインタープリターである。

func New

func New() *Runtime

New は未ロードのYaegi Runtimeを生成する。

func (*Runtime) DispatchHashChange added in v0.9.0

func (r *Runtime) DispatchHashChange(oldURL, newURL string)

DispatchHashChange はhashchange相当EventをPage callback queueへ追加する。

func (*Runtime) DispatchPageEvent added in v0.9.0

func (r *Runtime) DispatchPageEvent(callback func() bool) bool

DispatchPageEvent runs a browser-originated DOM event on the page queue and waits for cancelation/default-action state to become observable.

func (*Runtime) DispatchPopState added in v0.9.0

func (r *Runtime) DispatchPopState(state string)

DispatchPopState はpopstate相当EventをPage callback queueへ追加する。

func (*Runtime) HasAnimationFrameCallbacks added in v0.9.0

func (r *Runtime) HasAnimationFrameCallbacks() bool

HasAnimationFrameCallbacks reports whether the page requested another frame.

func (*Runtime) Load

func (r *Runtime) Load(ctx context.Context, scripts []runtimemodel.Script, environment runtimemodel.Environment) error

Load はスクリプトを検証し、実行せずにインタープリターを準備する。

func (*Runtime) RunAnimationFrame added in v0.9.0

func (r *Runtime) RunAnimationFrame(current time.Time) bool

RunAnimationFrame synchronously delivers one frame through the page queue.

func (*Runtime) SetBackground added in v0.10.0

func (r *Runtime) SetBackground(background bool)

SetBackground applies hidden-tab scheduling policy to this page runtime.

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context) error

Start はロード済みの全ファイルを評価し、main.mainを一度呼び出す。

func (*Runtime) Stop

func (r *Runtime) Stop() error

Stop は実行中の処理を中止する。複数回呼び出しても安全である。

func (*Runtime) UpdateLocation added in v0.9.0

func (r *Runtime) UpdateLocation(documentURL *url.URL)

UpdateLocation はsame-document Navigation後のURLをWebGo APIへ反映する。

Jump to

Keyboard shortcuts

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