Skip to content

Commit

Permalink
Merge branch 'main' into miniak/shell-open-external-log-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Feb 6, 2023
2 parents 3fd4a3d + 7dcd97f commit 3f61277
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/context-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ the API become immutable and updates on either side of the bridge do not result
An example of a complex API is shown below:

```javascript
const { contextBridge } = require('electron')
const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld(
'electron',
Expand Down
12 changes: 12 additions & 0 deletions shell/browser/mac/electron_application.mm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,18 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
return [super accessibilitySetValue:value forAttribute:attribute];
}

- (NSAccessibilityRole)accessibilityRole {
// For non-VoiceOver AT, such as Voice Control, Apple recommends turning on
// a11y when an AT accesses the 'accessibilityRole' property. This function
// is accessed frequently so we only change the accessibility state when
// accessibility is disabled.
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if (!ax_state->GetAccessibilityMode().has_mode(ui::kAXModeBasic.flags())) {
ax_state->AddAccessibilityModeFlags(ui::kAXModeBasic);
}
return [super accessibilityRole];
}

- (void)orderFrontStandardAboutPanel:(id)sender {
electron::Browser::Get()->ShowAboutPanel();
}
Expand Down

0 comments on commit 3f61277

Please sign in to comment.