debugger

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(target Debuggee, requiredVersion js.String) (ret js.Promise[js.Void])

Attach calls the function "WEBEXT.debugger.attach" directly.

func Detach

func Detach(target Debuggee) (ret js.Promise[js.Void])

Detach calls the function "WEBEXT.debugger.detach" directly.

func FuncAttach

func FuncAttach() (fn js.Func[func(target Debuggee, requiredVersion js.String) js.Promise[js.Void]])

FuncAttach returns the function "WEBEXT.debugger.attach".

func FuncDetach

func FuncDetach() (fn js.Func[func(target Debuggee) js.Promise[js.Void]])

FuncDetach returns the function "WEBEXT.debugger.detach".

func FuncGetTargets

func FuncGetTargets() (fn js.Func[func() js.Promise[js.Array[TargetInfo]]])

FuncGetTargets returns the function "WEBEXT.debugger.getTargets".

func FuncHasOnDetach

func FuncHasOnDetach() (fn js.Func[func(callback js.Func[func(source *Debuggee, reason DetachReason)]) bool])

FuncHasOnDetach returns the function "WEBEXT.debugger.onDetach.hasListener".

func FuncHasOnEvent

func FuncHasOnEvent() (fn js.Func[func(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) bool])

FuncHasOnEvent returns the function "WEBEXT.debugger.onEvent.hasListener".

func FuncOffDetach

func FuncOffDetach() (fn js.Func[func(callback js.Func[func(source *Debuggee, reason DetachReason)])])

FuncOffDetach returns the function "WEBEXT.debugger.onDetach.removeListener".

func FuncOffEvent

func FuncOffEvent() (fn js.Func[func(callback js.Func[func(source *Debuggee, method js.String, params js.Any)])])

FuncOffEvent returns the function "WEBEXT.debugger.onEvent.removeListener".

func FuncOnDetach

func FuncOnDetach() (fn js.Func[func(callback js.Func[func(source *Debuggee, reason DetachReason)])])

FuncOnDetach returns the function "WEBEXT.debugger.onDetach.addListener".

func FuncOnEvent

func FuncOnEvent() (fn js.Func[func(callback js.Func[func(source *Debuggee, method js.String, params js.Any)])])

FuncOnEvent returns the function "WEBEXT.debugger.onEvent.addListener".

func FuncSendCommand

func FuncSendCommand() (fn js.Func[func(target Debuggee, method js.String, commandParams js.Any) js.Promise[js.Any]])

FuncSendCommand returns the function "WEBEXT.debugger.sendCommand".

func GetTargets

func GetTargets() (ret js.Promise[js.Array[TargetInfo]])

GetTargets calls the function "WEBEXT.debugger.getTargets" directly.

func HasFuncAttach

func HasFuncAttach() bool

HasFuncAttach returns true if the function "WEBEXT.debugger.attach" exists.

func HasFuncDetach

func HasFuncDetach() bool

HasFuncDetach returns true if the function "WEBEXT.debugger.detach" exists.

func HasFuncGetTargets

func HasFuncGetTargets() bool

HasFuncGetTargets returns true if the function "WEBEXT.debugger.getTargets" exists.

func HasFuncHasOnDetach

func HasFuncHasOnDetach() bool

HasFuncHasOnDetach returns true if the function "WEBEXT.debugger.onDetach.hasListener" exists.

func HasFuncHasOnEvent

func HasFuncHasOnEvent() bool

HasFuncHasOnEvent returns true if the function "WEBEXT.debugger.onEvent.hasListener" exists.

func HasFuncOffDetach

func HasFuncOffDetach() bool

HasFuncOffDetach returns true if the function "WEBEXT.debugger.onDetach.removeListener" exists.

func HasFuncOffEvent

func HasFuncOffEvent() bool

HasFuncOffEvent returns true if the function "WEBEXT.debugger.onEvent.removeListener" exists.

func HasFuncOnDetach

func HasFuncOnDetach() bool

HasFuncOnDetach returns true if the function "WEBEXT.debugger.onDetach.addListener" exists.

func HasFuncOnEvent

func HasFuncOnEvent() bool

HasFuncOnEvent returns true if the function "WEBEXT.debugger.onEvent.addListener" exists.

func HasFuncSendCommand

func HasFuncSendCommand() bool

HasFuncSendCommand returns true if the function "WEBEXT.debugger.sendCommand" exists.

func HasOnDetach

func HasOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret bool)

HasOnDetach calls the function "WEBEXT.debugger.onDetach.hasListener" directly.

func HasOnEvent

func HasOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret bool)

HasOnEvent calls the function "WEBEXT.debugger.onEvent.hasListener" directly.

func OffDetach

func OffDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void)

OffDetach calls the function "WEBEXT.debugger.onDetach.removeListener" directly.

func OffEvent

func OffEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void)

OffEvent calls the function "WEBEXT.debugger.onEvent.removeListener" directly.

func OnDetach

func OnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void)

OnDetach calls the function "WEBEXT.debugger.onDetach.addListener" directly.

func OnEvent

func OnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void)

OnEvent calls the function "WEBEXT.debugger.onEvent.addListener" directly.

func SendCommand

func SendCommand(target Debuggee, method js.String, commandParams js.Any) (ret js.Promise[js.Any])

SendCommand calls the function "WEBEXT.debugger.sendCommand" directly.

func TryAttach

func TryAttach(target Debuggee, requiredVersion js.String) (ret js.Promise[js.Void], exception js.Any, ok bool)

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

func TryDetach

func TryDetach(target Debuggee) (ret js.Promise[js.Void], exception js.Any, ok bool)

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

func TryGetTargets

func TryGetTargets() (ret js.Promise[js.Array[TargetInfo]], exception js.Any, ok bool)

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

func TryHasOnDetach

func TryHasOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret bool, exception js.Any, ok bool)

TryHasOnDetach calls the function "WEBEXT.debugger.onDetach.hasListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryHasOnEvent

func TryHasOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret bool, exception js.Any, ok bool)

TryHasOnEvent calls the function "WEBEXT.debugger.onEvent.hasListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOffDetach

func TryOffDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void, exception js.Any, ok bool)

TryOffDetach calls the function "WEBEXT.debugger.onDetach.removeListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOffEvent

func TryOffEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void, exception js.Any, ok bool)

TryOffEvent calls the function "WEBEXT.debugger.onEvent.removeListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOnDetach

func TryOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void, exception js.Any, ok bool)

TryOnDetach calls the function "WEBEXT.debugger.onDetach.addListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TryOnEvent

func TryOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void, exception js.Any, ok bool)

TryOnEvent calls the function "WEBEXT.debugger.onEvent.addListener" in a try/catch block and returns (_, err, ok = false) when it went through the catch clause.

func TrySendCommand

func TrySendCommand(target Debuggee, method js.String, commandParams js.Any) (ret js.Promise[js.Any], exception js.Any, ok bool)

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

Types

type Debuggee

type Debuggee struct {
	// ExtensionId is "Debuggee.extensionId"
	//
	// Optional
	ExtensionId js.String
	// TabId is "Debuggee.tabId"
	//
	// Optional
	//
	// NOTE: FFI_USE_TabId MUST be set to true to make this field effective.
	TabId int64
	// TargetId is "Debuggee.targetId"
	//
	// Optional
	TargetId js.String

	FFI_USE_TabId bool // for TabId.

	FFI_USE bool
}

func (*Debuggee) FreeMembers

func (p *Debuggee) FreeMembers(recursive bool)

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

func (Debuggee) FromRef

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

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

func (Debuggee) New

func (p Debuggee) New() js.Ref

New creates a new Debuggee in the application heap.

func (*Debuggee) Update

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

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

func (*Debuggee) UpdateFrom

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

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

type DetachReason

type DetachReason uint32
const (
	DetachReason_TARGET_CLOSED DetachReason
	DetachReason_CANCELED_BY_USER
)

func (DetachReason) FromRef

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

func (DetachReason) String

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

type OnDetachEventCallback

type OnDetachEventCallback[T any] struct {
	Fn  func(arg T, this js.Ref, source *Debuggee, reason DetachReason) js.Ref
	Arg T
}

func (*OnDetachEventCallback[T]) DispatchCallback

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

func (*OnDetachEventCallback[T]) Register

func (cb *OnDetachEventCallback[T]) Register() js.Func[func(source *Debuggee, reason DetachReason)]

type OnDetachEventCallbackFunc

type OnDetachEventCallbackFunc func(this js.Ref, source *Debuggee, reason DetachReason) js.Ref

func (OnDetachEventCallbackFunc) DispatchCallback

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

func (OnDetachEventCallbackFunc) Register

func (fn OnDetachEventCallbackFunc) Register() js.Func[func(source *Debuggee, reason DetachReason)]

type OnEventEventCallback

type OnEventEventCallback[T any] struct {
	Fn  func(arg T, this js.Ref, source *Debuggee, method js.String, params js.Any) js.Ref
	Arg T
}

func (*OnEventEventCallback[T]) DispatchCallback

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

func (*OnEventEventCallback[T]) Register

func (cb *OnEventEventCallback[T]) Register() js.Func[func(source *Debuggee, method js.String, params js.Any)]

type OnEventEventCallbackFunc

type OnEventEventCallbackFunc func(this js.Ref, source *Debuggee, method js.String, params js.Any) js.Ref

func (OnEventEventCallbackFunc) DispatchCallback

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

func (OnEventEventCallbackFunc) Register

func (fn OnEventEventCallbackFunc) Register() js.Func[func(source *Debuggee, method js.String, params js.Any)]

type TargetInfo

type TargetInfo struct {
	// Attached is "TargetInfo.attached"
	//
	// Required
	Attached bool
	// ExtensionId is "TargetInfo.extensionId"
	//
	// Optional
	ExtensionId js.String
	// FaviconUrl is "TargetInfo.faviconUrl"
	//
	// Optional
	FaviconUrl js.String
	// Id is "TargetInfo.id"
	//
	// Required
	Id js.String
	// TabId is "TargetInfo.tabId"
	//
	// Optional
	//
	// NOTE: FFI_USE_TabId MUST be set to true to make this field effective.
	TabId int64
	// Title is "TargetInfo.title"
	//
	// Required
	Title js.String
	// Type is "TargetInfo.type"
	//
	// Required
	Type TargetInfoType
	// Url is "TargetInfo.url"
	//
	// Required
	Url js.String

	FFI_USE_TabId bool // for TabId.

	FFI_USE bool
}

func (*TargetInfo) FreeMembers

func (p *TargetInfo) FreeMembers(recursive bool)

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

func (TargetInfo) FromRef

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

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

func (TargetInfo) New

func (p TargetInfo) New() js.Ref

New creates a new TargetInfo in the application heap.

func (*TargetInfo) Update

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

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

func (*TargetInfo) UpdateFrom

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

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

type TargetInfoType

type TargetInfoType uint32
const (
	TargetInfoType_PAGE TargetInfoType
	TargetInfoType_BACKGROUND_PAGE
	TargetInfoType_WORKER
	TargetInfoType_OTHER
)

func (TargetInfoType) FromRef

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

func (TargetInfoType) String

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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