new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · Tutorial · all subjects

accessibility

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

app.setAccessibilitySupportEnabled() API

Electron provides the app.setAccessibilitySupportEnabled(enabled) API to manually expose Chrome's accessibility tree to users in the application preferences. The user's system assistive utilities have priority over this setting and will override it.

Automatic accessibility feature detection

Electron applications automatically enable accessibility features in the presence of assistive technology such as JAWS on Windows or VoiceOver on macOS.

Enable accessibility on macOS via AXManualAccessibility attribute

On macOS, third-party assistive technology can toggle accessibility features inside Electron applications by setting the AXManualAccessibility attribute programmatically using AXUIElementSetAttributeValue.

Objective-C example for macOS accessibility control

This Objective-C code enables or disables accessibility in an Electron application by setting the AXManualAccessibility attribute: ```objc CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility"); + (void)enableAccessibility:(BOOL)enable inElectronApplication:(NSRunningApplication *)app { AXUIElementRef appRef = AXUIElementCreateApplication(app.processIdentifier); if (appRef == nil) return; CFBooleanRef value = enable ? kCFBooleanTrue : kCFBooleanFalse; AXUIElementSetAttributeValue(appRef, kAXManualAccessibility, value); CFRelease(appRef); } ```

Swift example for macOS accessibility control

This Swift code sets the AXManualAccessibility attribute on an Electron application: ```swift import Cocoa let name = CommandLine.arguments.count >= 2 ? CommandLine.arguments[1] : "Electron" let pid = NSWorkspace.shared.runningApplications.first(where: {$0.localizedName == name})!.processIdentifier let axApp = AXUIElementCreateApplication(pid) let result = AXUIElementSetAttributeValue(axApp, "AXManualAccessibility" as CFString, true as CFTypeRef) print("Setting 'AXManualAccessibility' \(error.rawValue == 0 ? "succeeded" : "failed")") ```

Give your agent this brain