Documentation
¶
Index ¶
- func BytePtrToString(ptr uintptr) string
- func CheckScreenCapture()
- func CheckTrust()
- func ConfigureIdentity(appName, bundleID string)
- func IsScreenRecordingTrusted() bool
- func IsTrusted() bool
- func MkString(s string) uintptr
- func PrivacySettingsURL(service string) string
- func RequestAccessibilityPermission()
- func RequestScreenCapturePermission()
- func ResetTCC(service string)
- func ScreenCaptureTerminateGuardActive() bool
- func ShouldTerminateReply(app appkit.NSApplication) appkit.NSApplicationTerminateReply
- func WaitForAccessibility(timeout time.Duration) bool
- func WaitForScreenRecording(timeout time.Duration) bool
- func WaitForWindows()
- type App
- type Attributes
- type Device
- type Element
- func (e *Element) Attributes() Attributes
- func (e *Element) Buttons() []*Element
- func (e *Element) Children() []*Element
- func (e *Element) ElementByID(id string) *Element
- func (e *Element) Exists() bool
- func (e *Element) FindChildren(role string) []*Element
- func (e *Element) Frame() corefoundation.CGRect
- func (e *Element) Identifier() string
- func (e *Element) Label() string
- func (e *Element) PerformAction(action string)
- func (e *Element) Query(p QueryParams) []*Element
- func (e *Element) Role() string
- func (e *Element) Screenshot() ([]byte, error)
- func (e *Element) Tap()
- func (e *Element) Title() string
- func (e *Element) Tree() string
- func (e *Element) VisualTree() string
- func (e *Element) Windows() []*Element
- type PermissionSnapshot
- type PermissionStatus
- type QueryParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytePtrToString ¶
func CheckScreenCapture ¶
func CheckScreenCapture()
CheckScreenCapture checks if the process has Screen Recording permission and, if not, shows a floating HIG-style window. It polls until permission is granted, then briefly shows a green checkmark before closing.
func CheckTrust ¶
func CheckTrust()
func ConfigureIdentity ¶
func ConfigureIdentity(appName, bundleID string)
ConfigureIdentity sets the app name and bundle identifier used for TCC prompts and resets.
func IsScreenRecordingTrusted ¶
func IsScreenRecordingTrusted() bool
IsScreenRecordingTrusted checks if screen recording permission is granted without triggering a system prompt. It falls back to an actual capture test when the preflight API returns false, which handles post-re-sign scenarios where the TCC grant no longer matches the code signature.
func IsTrusted ¶
func IsTrusted() bool
IsTrusted reports whether the process has Accessibility permission.
func PrivacySettingsURL ¶ added in v0.2.0
func RequestAccessibilityPermission ¶ added in v0.2.0
func RequestAccessibilityPermission()
func RequestScreenCapturePermission ¶ added in v0.2.0
func RequestScreenCapturePermission()
func ScreenCaptureTerminateGuardActive ¶ added in v0.2.0
func ScreenCaptureTerminateGuardActive() bool
func ShouldTerminateReply ¶ added in v0.2.0
func ShouldTerminateReply(app appkit.NSApplication) appkit.NSApplicationTerminateReply
func WaitForAccessibility ¶ added in v0.2.0
func WaitForScreenRecording ¶
WaitForScreenRecording shows the permission window if screen recording is not already granted and blocks until permission is granted or the timeout expires. It returns true if permission was granted, false on timeout.
func WaitForWindows ¶
func WaitForWindows()
WaitForWindows blocks until all permission windows have finished their close animations. Call this before os.Exit to avoid cutting off the green checkmark transition.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App ...
func Application ¶
func Application() *App
func ApplicationWithBundleID ¶
type Attributes ¶
type Attributes struct {
Label string
Identifier string
Title string
Value string
Frame corefoundation.CGRect
Enabled bool
Selected bool
HasFocus bool
}
Attributes struct for Inspect
type Device ¶
type Device struct{}
Device stub for AX
func SharedDevice ¶
func SharedDevice() *Device
func (*Device) PressVolumeDown ¶
func (d *Device) PressVolumeDown()
func (*Device) PressVolumeUp ¶
func (d *Device) PressVolumeUp()
func (*Device) SetOrientation ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element
func ElementByID ¶
func (*Element) Attributes ¶
func (e *Element) Attributes() Attributes
func (*Element) ElementByID ¶
func (*Element) FindChildren ¶
Helper filter functions
func (*Element) Frame ¶
func (e *Element) Frame() corefoundation.CGRect
func (*Element) Identifier ¶
func (*Element) PerformAction ¶
func (*Element) Query ¶
func (e *Element) Query(p QueryParams) []*Element
func (*Element) Screenshot ¶
func (*Element) VisualTree ¶
VisualTree returns a tree representation of the element and its children using ASCII box-drawing characters.
type PermissionSnapshot ¶ added in v0.2.0
type PermissionSnapshot struct {
Accessibility PermissionStatus
ScreenRecording PermissionStatus
Pending bool
Message string
}
func CurrentPermissionSnapshot ¶ added in v0.2.0
func CurrentPermissionSnapshot() PermissionSnapshot
type PermissionStatus ¶ added in v0.2.0
type PermissionStatus string
const ( PermissionStatusGranted PermissionStatus = "granted" PermissionStatusMissing PermissionStatus = "missing" PermissionStatusInProgress PermissionStatus = "in_progress" )