offscreen

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDocument

func CloseDocument() (ret js.Promise[js.Void])

CloseDocument calls the function "WEBEXT.offscreen.closeDocument" directly.

func CreateDocument

func CreateDocument(parameters CreateParameters) (ret js.Promise[js.Void])

CreateDocument calls the function "WEBEXT.offscreen.createDocument" directly.

func FuncCloseDocument

func FuncCloseDocument() (fn js.Func[func() js.Promise[js.Void]])

FuncCloseDocument returns the function "WEBEXT.offscreen.closeDocument".

func FuncCreateDocument

func FuncCreateDocument() (fn js.Func[func(parameters CreateParameters) js.Promise[js.Void]])

FuncCreateDocument returns the function "WEBEXT.offscreen.createDocument".

func FuncHasDocument

func FuncHasDocument() (fn js.Func[func() js.Promise[js.Boolean]])

FuncHasDocument returns the function "WEBEXT.offscreen.hasDocument".

func HasDocument

func HasDocument() (ret js.Promise[js.Boolean])

HasDocument calls the function "WEBEXT.offscreen.hasDocument" directly.

func HasFuncCloseDocument

func HasFuncCloseDocument() bool

HasFuncCloseDocument returns true if the function "WEBEXT.offscreen.closeDocument" exists.

func HasFuncCreateDocument

func HasFuncCreateDocument() bool

HasFuncCreateDocument returns true if the function "WEBEXT.offscreen.createDocument" exists.

func HasFuncHasDocument

func HasFuncHasDocument() bool

HasFuncHasDocument returns true if the function "WEBEXT.offscreen.hasDocument" exists.

func TryCloseDocument

func TryCloseDocument() (ret js.Promise[js.Void], exception js.Any, ok bool)

TryCloseDocument calls the function "WEBEXT.offscreen.closeDocument" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryCreateDocument

func TryCreateDocument(parameters CreateParameters) (ret js.Promise[js.Void], exception js.Any, ok bool)

TryCreateDocument calls the function "WEBEXT.offscreen.createDocument" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryHasDocument

func TryHasDocument() (ret js.Promise[js.Boolean], exception js.Any, ok bool)

TryHasDocument calls the function "WEBEXT.offscreen.hasDocument" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

Types

type BooleanCallback

type BooleanCallback[T any] struct {
	Fn  func(arg T, this js.Ref, result bool) js.Ref
	Arg T
}

func (*BooleanCallback[T]) DispatchCallback

func (cb *BooleanCallback[T]) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (*BooleanCallback[T]) Register

func (cb *BooleanCallback[T]) Register() js.Func[func(result bool)]

type BooleanCallbackFunc

type BooleanCallbackFunc func(this js.Ref, result bool) js.Ref

func (BooleanCallbackFunc) DispatchCallback

func (fn BooleanCallbackFunc) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (BooleanCallbackFunc) Register

func (fn BooleanCallbackFunc) Register() js.Func[func(result bool)]

type CreateParameters

type CreateParameters struct {
	// Reasons is "CreateParameters.reasons"
	//
	// Optional
	Reasons js.Array[Reason]
	// Url is "CreateParameters.url"
	//
	// Optional
	Url js.String
	// Justification is "CreateParameters.justification"
	//
	// Optional
	Justification js.String

	FFI_USE bool
}

func (*CreateParameters) FreeMembers

func (p *CreateParameters) FreeMembers(recursive bool)

FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.

func (CreateParameters) FromRef

func (p CreateParameters) FromRef(ref js.Ref) CreateParameters

FromRef calls UpdateFrom and returns a CreateParameters with all fields set.

func (CreateParameters) New

func (p CreateParameters) New() js.Ref

New creates a new CreateParameters in the application heap.

func (*CreateParameters) Update

func (p *CreateParameters) Update(ref js.Ref)

Update writes all fields of the p to the heap object referenced by ref.

func (*CreateParameters) UpdateFrom

func (p *CreateParameters) UpdateFrom(ref js.Ref)

UpdateFrom copies value of all fields of the heap object to p.

type Reason

type Reason uint32
const (
	Reason_TESTING Reason
	Reason_AUDIO_PLAYBACK
	Reason_IFRAME_SCRIPTING
	Reason_DOM_SCRAPING
	Reason_BLOBS
	Reason_DOM_PARSER
	Reason_USER_MEDIA
	Reason_DISPLAY_MEDIA
	Reason_WEB_RTC
	Reason_CLIPBOARD
	Reason_LOCAL_STORAGE
	Reason_WORKERS
	Reason_BATTERY_STATUS
	Reason_MATCH_MEDIA
	Reason_GEOLOCATION
)

func (Reason) FromRef

func (Reason) FromRef(str js.Ref) Reason

func (Reason) String

func (x Reason) String() (string, bool)

type VoidCallback

type VoidCallback[T any] struct {
	Fn  func(arg T, this js.Ref) js.Ref
	Arg T
}

func (*VoidCallback[T]) DispatchCallback

func (cb *VoidCallback[T]) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (*VoidCallback[T]) Register

func (cb *VoidCallback[T]) Register() js.Func[func()]

type VoidCallbackFunc

type VoidCallbackFunc func(this js.Ref) js.Ref

func (VoidCallbackFunc) DispatchCallback

func (fn VoidCallbackFunc) DispatchCallback(
	targetPC uintptr, ctx *js.CallbackContext,
)

func (VoidCallbackFunc) Register

func (fn VoidCallbackFunc) Register() js.Func[func()]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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