From 94dd068e15314ba990fb7b96a6c8e4ff100b19c1 Mon Sep 17 00:00:00 2001 From: Ivan Mir Date: Sat, 19 Aug 2017 17:18:12 -0300 Subject: [PATCH] Special attribute for macOS accessibility #7206 In the linked issue we were discussing that Electron apps are inaccessible unless VoiceOver is enabled. While it's a working solution for users with vision impairment, all other users and apps that require accessibility can't interact with Electron-based software because they don't keep VoiceOver running. I suggest adding `AXManualAccessibility` for programmatically enabling it in Electron apps. The reason for a new attribute is that `AXEnhancedUserInterface` is already reserved by VoiceOver. Adding this attribute will allow both Electron developers and 3rd party developers to enable and disable accessibility from their code by calling `accessibilitySetValue:forAttribute:` on the application. It will be also possible to create a small utility app to switch accessibility in Electron-based apps until there's a native UI solution (like the accessibility settings page in Chrome). --- atom/browser/mac/atom_application.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/atom/browser/mac/atom_application.mm b/atom/browser/mac/atom_application.mm index 4a0e18401664..52975e30c7a8 100644 --- a/atom/browser/mac/atom_application.mm +++ b/atom/browser/mac/atom_application.mm @@ -72,6 +72,9 @@ bool enableAccessibility = ([self voiceOverEnabled] && [value boolValue]); [self updateAccessibilityEnabled:enableAccessibility]; } + else if ([attribute isEqualToString:@"AXManualAccessibility"]) { + [self updateAccessibilityEnabled:[value boolValue]]; + } return [super accessibilitySetValue:value forAttribute:attribute]; }