Skip to content

Commit 707eb8d

Browse files
authored
fix: remove clickable role injection (#19)
1 parent 24d6515 commit 707eb8d

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

internal/accessibility/element.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -367,25 +367,7 @@ func (e *Element) IsClickable() bool {
367367
_, ok := clickableRoles[info.Role]
368368
clickableRolesMu.RUnlock()
369369

370-
if ok {
371-
return true
372-
}
373-
374-
// For elements not in the clickable roles list, check if they have a click action
375-
// This is important for web content in Electron apps where elements may have
376-
// roles like AXGroup or AXStaticText but still be clickable
377-
// However, only check for specific roles that are commonly clickable in web content
378-
// to avoid detecting too many elements
379-
if info.Role == "AXGroup" || info.Role == "AXImage" {
380-
if bridge.HasClickAction(e.ref) {
381-
logger.Debug("Element has click action despite non-standard role",
382-
zap.String("role", info.Role),
383-
zap.String("title", info.Title))
384-
return true
385-
}
386-
}
387-
388-
return false
370+
return ok
389371
}
390372

391373
// GetAllWindows returns all windows of the focused application

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func (c *Config) GetScrollableRolesForApp(bundleID string) []string {
428428
func (c *Config) Save(path string) error {
429429
// Create directory if it doesn't exist
430430
dir := filepath.Dir(path)
431-
if err := os.MkdirAll(dir, 0755); err != nil {
431+
if err := os.MkdirAll(dir, 0o755); err != nil {
432432
return fmt.Errorf("failed to create config directory: %w", err)
433433
}
434434

0 commit comments

Comments
 (0)