Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion browser_patches/firefox/juggler/content/PageAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,23 @@ export class PageAgent {
tip.commitCompositionWith(text, keyEvent);
} else {
const flags = 0;
tip.keydown(keyEvent, flags);
// On macOS, Firefox treats Option+<printable key> as text input. Empty text
// means no text should be inserted, so we consume keydown after the page
// has seen it, which prevents the keypress, same as in Chromium and WebKit.
const suppressTextInput = !text && [...key].length === 1 && Services.appinfo.OS === 'Darwin';
if (!suppressTextInput) {
tip.keydown(keyEvent, flags);
} else {
const dispose = helper.addEventListener(this._docShell.chromeEventHandler, 'keydown', event => {
if (event.altKey && !event.ctrlKey && !event.metaKey)
event.preventDefault();
}, { capture: true, mozSystemGroup: true });
try {
tip.keydown(keyEvent, flags);
} finally {
dispose();
}
}
}
} else if (type === 'keyup') {
if (text)
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"name": "firefox",
"revision": "1551",
"revision": "1552",
"installByDefault": true,
"browserVersion": "156.0",
"title": "Firefox"
Expand Down
Loading