Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 150e764

Browse files
committed
Hot patch support for aria role textbox on password fields
This commit closes #13 for now but #15 is meant to track if this is the rigth approach.
1 parent c95f078 commit 150e764

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/recorder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export default async (url: string) => {
4040

4141
let script = readFileSync(path.join(__dirname, '../lib/inject.js'), { encoding: 'utf-8' })
4242
script = script.replace(`var childNodes = [];`, `var childNodes = Array.from(node.shadowRoot?.childNodes || []).filter(n => !getOwner(n) && !isHidden(n))`);
43+
// Todo(https://github.com/puppeteer/recorder/issues/15): Check if this is the right approach
44+
script = script.replace(`'input[type="text"]:not([list])',`, `'input[type="text"]:not([list])',\n'input[type="password"]:not([list])',`);
4345
page.evaluateOnNewDocument(script);
4446

4547
// Setup puppeteer

src/runner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ declare const __dirname;
2525
let aria = fs.readFileSync(path.join(__dirname, '../node_modules/aria-api/dist/aria.js'), { encoding: 'utf8' });
2626

2727
aria = aria.replace(`var childNodes = [];`, `var childNodes = Array.from(node.shadowRoot?.childNodes || []).filter(n => !getOwner(n) && !isHidden(n))`);
28+
// Todo(https://github.com/puppeteer/recorder/issues/15): Check if this is the right approach
29+
aria = aria.replace(`'input[type="text"]:not([list])',`, `'input[type="text"]:not([list])',\n'input[type="password"]:not([list])',`);
2830

2931
const ariaSelectorEngine = new Function('element', 'selector', `
3032
// Inject the aria library in case it has not been loaded yet

0 commit comments

Comments
 (0)