fix: toggle devtools menu item for BaseWindow#49356
Conversation
BaseWindow
764c670 to
cb36f07
Compare
|
The current commit doesn't address the review so please don't view it. |
BaseWindowBaseWindow
BaseWindowBaseWindow
|
Is it easy to add a test that sending the keyboard shortcut to the application toggles the devtools? I remember @codebytere mentioning AppleScript as a potential way to do it in a similar context. |
|
@nikwen what can I do next ? |
76cf541 to
91c7665
Compare
|
discloser: test was written by claude. I asked for suggestion on writing test and found it good enough. |
nikwen
left a comment
There was a problem hiding this comment.
Thanks for working on this! We're almost there. 🙂
e3740e7 to
149b257
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Hey @ckerr , Can you please approve this PR 🙂 ? |
|
Release Notes Persisted
|
|
I have automatically backported this PR to "43-x-y", please check out #51901 |
|
I have automatically backported this PR to "41-x-y", please check out #51902 |
|
I have automatically backported this PR to "42-x-y", please check out #51903 |
|
Thank you for your time and reviews. 🙂 |
Description of Change
Fixes: #45821, #45386
This PR fixes a "JavaScript error in main process" that occurs when a developer attempts to trigger the
toggleDevToolswhen runningBaseWindow. UnlikeBrowserWindow,BaseWindowhave multipleWebContentswhich cause it to fail. This changes the logic to target the currently focusedWebContentsregardless of the window.Root Cause
The pervious implementation of the
toggledevtoolsmenu role usedgetOwnerBrowserWindow()which returns{}when window is hosted within aBaseWindowand later when function calltoggleDevToolswas made it causes JS error .Checklist
npm testpassesRelease Notes
Notes: Fixed an issue where the "Toggle Developer Tools" menu item failed to function correctly with BaseWindow.