Documentation
¶
Index ¶
- func Attach(target Debuggee, requiredVersion js.String) (ret js.Promise[js.Void])
- func Detach(target Debuggee) (ret js.Promise[js.Void])
- func FuncAttach() (...)
- func FuncDetach() (fn js.Func[func(target Debuggee) js.Promise[js.Void]])
- func FuncGetTargets() (fn js.Func[func() js.Promise[js.Array[TargetInfo]]])
- func FuncHasOnDetach() (...)
- func FuncHasOnEvent() (...)
- func FuncOffDetach() (...)
- func FuncOffEvent() (...)
- func FuncOnDetach() (...)
- func FuncOnEvent() (...)
- func FuncSendCommand() (...)
- func GetTargets() (ret js.Promise[js.Array[TargetInfo]])
- func HasFuncAttach() bool
- func HasFuncDetach() bool
- func HasFuncGetTargets() bool
- func HasFuncHasOnDetach() bool
- func HasFuncHasOnEvent() bool
- func HasFuncOffDetach() bool
- func HasFuncOffEvent() bool
- func HasFuncOnDetach() bool
- func HasFuncOnEvent() bool
- func HasFuncSendCommand() bool
- func HasOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret bool)
- func HasOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret bool)
- func OffDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void)
- func OffEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void)
- func OnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void)
- func OnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void)
- func SendCommand(target Debuggee, method js.String, commandParams js.Any) (ret js.Promise[js.Any])
- func TryAttach(target Debuggee, requiredVersion js.String) (ret js.Promise[js.Void], exception js.Any, ok bool)
- func TryDetach(target Debuggee) (ret js.Promise[js.Void], exception js.Any, ok bool)
- func TryGetTargets() (ret js.Promise[js.Array[TargetInfo]], exception js.Any, ok bool)
- func TryHasOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret bool, exception js.Any, ok bool)
- func TryHasOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret bool, exception js.Any, ok bool)
- func TryOffDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void, exception js.Any, ok bool)
- func TryOffEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void, exception js.Any, ok bool)
- func TryOnDetach(callback js.Func[func(source *Debuggee, reason DetachReason)]) (ret js.Void, exception js.Any, ok bool)
- func TryOnEvent(callback js.Func[func(source *Debuggee, method js.String, params js.Any)]) (ret js.Void, exception js.Any, ok bool)
- func TrySendCommand(target Debuggee, method js.String, commandParams js.Any) (ret js.Promise[js.Any], exception js.Any, ok bool)
- type Debuggee
- type DetachReason
- type OnDetachEventCallback
- type OnDetachEventCallbackFunc
- type OnEventEventCallback
- type OnEventEventCallbackFunc
- type TargetInfo
- type TargetInfoType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
FuncDetach returns the function "WEBEXT.debugger.detach".
func FuncGetTargets ¶
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 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 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 ¶
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 ¶
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 ¶
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 ¶
FreeMembers frees fields with heap reference, if recursive is true free all heap references reachable from p.
func (*Debuggee) UpdateFrom ¶
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 ¶
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, )
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, )
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)