Documentation
¶
Index ¶
- func BlockApp(appName, title, reason string, tags []string) error
- func BlockURL(targetURL, title, reason string, tags []string, appName string) error
- func GetIdentity() (string, error)
- func IsBrowser(bundleID string) bool
- func OnIdleChange(callback func(idleSeconds float64))
- func OnTitleChange(callback func(event NativeEvent))
- func OpenAutomationSettings()
- func RequestAutomationPermission(bundleID string) bool
- type AxEventType
- type NativeEvent
- type NativeService
- func (s *NativeService) CheckAccessibility() bool
- func (s *NativeService) DisableLoginItem() error
- func (s *NativeService) EnableLoginItem() error
- func (s *NativeService) LoginItemEnabled() bool
- func (s *NativeService) OpenSettings()
- func (s *NativeService) RequestAccessibility() bool
- func (s *NativeService) RequestAutomation(bundleID string) bool
- func (s *NativeService) StartObserver()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIdentity ¶
func OnIdleChange ¶
func OnIdleChange(callback func(idleSeconds float64))
func OnTitleChange ¶
func OnTitleChange(callback func(event NativeEvent))
func OpenAutomationSettings ¶ added in v0.0.21
func OpenAutomationSettings()
OpenAutomationSettings opens the macOS System Settings directly to the Automation page
func RequestAutomationPermission ¶ added in v0.0.21
RequestAutomationPermission runs a harmless AppleScript to intentionally trigger the macOS TCC prompt right away during your onboarding UI.
Types ¶
type AxEventType ¶
type AxEventType int
AxEventType represents the type of accessibility event
const ( // AxEventTypeTitle is fired when the frontmost window's title changes AxEventTypeTitle AxEventType = 1 // AxEventTypeIdle is fired when user idle state changes AxEventTypeIdle AxEventType = 2 )
type NativeEvent ¶
type NativeEvent struct {
Type AxEventType
PID int
ExecutablePath string
AppName string
BundleID string
Icon string
Title string
AppIcon string // base64 encoded PNG
URL string
}
NativeEvent represents an accessibility event from the observer
func (*NativeEvent) BrowserHostname ¶
func (e *NativeEvent) BrowserHostname() string
func (*NativeEvent) Domain ¶
func (e *NativeEvent) Domain() string
type NativeService ¶ added in v0.0.21
type NativeService struct {
// contains filtered or unexported fields
}
NativeService is a Wails-bound service for managing macOS permissions during the onboarding flow.
func NewNativeService ¶ added in v0.0.21
func NewNativeService() *NativeService
func (*NativeService) CheckAccessibility ¶ added in v0.0.21
func (s *NativeService) CheckAccessibility() bool
CheckAccessibility returns whether Accessibility permission is currently granted, without prompting the user.
func (*NativeService) DisableLoginItem ¶ added in v0.0.21
func (s *NativeService) DisableLoginItem() error
DisableLoginItem unregisters the app from opening at login.
func (*NativeService) EnableLoginItem ¶ added in v0.0.21
func (s *NativeService) EnableLoginItem() error
EnableLoginItem registers the app to open at login.
func (*NativeService) LoginItemEnabled ¶ added in v0.0.21
func (s *NativeService) LoginItemEnabled() bool
LoginItemEnabled returns whether the app is currently registered to open at login.
func (*NativeService) OpenSettings ¶ added in v0.0.21
func (s *NativeService) OpenSettings()
OpenSettings opens System Settings → Privacy & Security → Automation.
func (*NativeService) RequestAccessibility ¶ added in v0.0.21
func (s *NativeService) RequestAccessibility() bool
RequestAccessibility prompts the user for Accessibility permission via the macOS system dialog. Returns true if already granted or the user grants it.
func (*NativeService) RequestAutomation ¶ added in v0.0.21
func (s *NativeService) RequestAutomation(bundleID string) bool
RequestAutomation triggers the macOS TCC prompt for a specific app bundle ID. Returns true if permission was granted (or was already granted).
func (*NativeService) StartObserver ¶ added in v0.0.21
func (s *NativeService) StartObserver()