Skip to content

Commit

Permalink
performance: turn on a11y caches (#2153)
Browse files Browse the repository at this point in the history
Fixes [OOM](https://crbug.com/336718011) from trying to re-build a11y
caches.
  • Loading branch information
OrKoN authored Apr 24, 2024
1 parent ed460ae commit dda4c0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bidiMapper/modules/context/BrowsingContextImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,15 @@ export class BrowsingContextImpl {
'Either name or role has to be specified'
);
}

// The next two commands cause a11y caches for the target to be
// preserved. We probably do not need to disable them if the
// client is using a11y features but we could by calling
// Accessibility.disable.
await Promise.all([
this.#cdpTarget.cdpClient.sendCommand('Accessibility.enable'),
this.#cdpTarget.cdpClient.sendCommand('Accessibility.getRootAXNode'),
]);
const bindings = await realm.evaluate(
/* expression=*/ '({getAccessibleName, getAccessibleRole})',
/* awaitPromise=*/ false,
Expand Down

0 comments on commit dda4c0d

Please sign in to comment.