commit | 5d508f6420f65a7d32aa2a267e63299f2857c02f | [log] [tgz] |
---|---|---|
author | Benedikt Meurer <[email protected]> | Tue Dec 06 14:37:38 2022 |
committer | Devtools-frontend LUCI CQ <devtools-frontend-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Dec 06 17:55:47 2022 |
tree | 15af111f98c9adaa3322e6a8f7c3d1a8797d07cd | |
parent | 326f0207df7761cd78d7e3ffbc527715eed51338 [diff] [blame] |
[extensions] Extend workaround for extension hotkeys. This extends the workaround from https://crrev.com/c/1876809 to also prevent extensions from forwarding hotkeys to DevTools if they would normally insert a letter like for example 'h' into a contenteditable HTML element. Bug: chromium:923338 Change-Id: I223e4770e5573b2136a2b888b1958308a933986e Fixed: chromium:1178327 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4079094 Commit-Queue: Yang Guo <[email protected]> Auto-Submit: Benedikt Meurer <[email protected]> Reviewed-by: Yang Guo <[email protected]>
diff --git a/front_end/models/extensions/ExtensionAPI.ts b/front_end/models/extensions/ExtensionAPI.ts index 108caac..04d576a 100644 --- a/front_end/models/extensions/ExtensionAPI.ts +++ b/front_end/models/extensions/ExtensionAPI.ts
@@ -1272,7 +1272,8 @@ // This is a workaround for crbug.com/923338. const focused = document.activeElement; if (focused) { - const isInput = focused.nodeName === 'INPUT' || focused.nodeName === 'TEXTAREA'; + const isInput = + focused.nodeName === 'INPUT' || focused.nodeName === 'TEXTAREA' || (focused as HTMLElement).isContentEditable; if (isInput && !(event.ctrlKey || event.altKey || event.metaKey)) { return; }