native

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockApp

func BlockApp(appName, title, reason string, tags []string) error

func BlockURL

func BlockURL(targetURL, title, reason string, tags []string, appName string) error

func GetIdentity

func GetIdentity() (string, error)

func IsBrowser

func IsBrowser(bundleID string) bool

IsBrowser checks if the given bundleID is a known browser

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

func RequestAutomationPermission(bundleID string) bool

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()

Jump to

Keyboard shortcuts

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