Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: webContents.openDevTools({mode}) not working #32829

Merged
merged 1 commit into from Feb 17, 2022

Conversation

codebytere
Copy link
Member

Description of Change

Closes #32702.

Electron calls into UI.DockController.instance().setDockSide(side) in order to allow users to set the devtools dock position via webContents.openDevTools({ mode }). In this DevTools CL the globals which we used to enable this were removed, and so we need to re-expose them to fix this broken functionality. We should look to upstream a more durable approach to allowing us to do this.

Tested by adding mainWindow.webContents.openDevTools({ mode: 'left' }) to the default stock Fiddle and observing that it no longer errors and the devtools docks appropriately to the left-hand side.

Checklist

Release Notes

Notes: Fixed an issue where webContents.openDevTools({ mode }) did not work for certain dock positions.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/17-x-y labels Feb 9, 2022
@codebytere codebytere requested a review from a team as a code owner February 9, 2022 10:14
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 9, 2022
@nornagon
Copy link
Member

nornagon commented Feb 9, 2022

hrm. Chrome manages to open devtools on a particular side without this hack. How does it work in Chrome?

@codebytere
Copy link
Member Author

codebytere commented Feb 9, 2022

@nornagon to my knowledge it's never done programmatically - it's done here via button click listeners.

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should find a better way but this isn't awful

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 10, 2022
@zcbenz zcbenz merged commit 84cf685 into main Feb 17, 2022
@zcbenz zcbenz deleted the fix-devtools-broken-mode branch February 17, 2022 05:59
@release-clerk
Copy link

release-clerk bot commented Feb 17, 2022

Release Notes Persisted

Fixed an issue where webContents.openDevTools({ mode }) did not work for certain dock positions.

@trop
Copy link
Contributor

trop bot commented Feb 17, 2022

I have automatically backported this PR to "17-x-y", please check out #32945

@trop
Copy link
Contributor

trop bot commented Feb 17, 2022

I have automatically backported this PR to "18-x-y", please check out #32946

@dsanders11
Copy link
Member

@zcbenz @codebytere, looks like this landing broke gclient sync on CI due to the patch.

@zcbenz
Copy link
Member

zcbenz commented Feb 17, 2022

Thanks for noticing it, I created a PR at #32950.

@trop trop bot added the merged/18-x-y label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: mainWindow.webContents.openDevTools modes no longer work
5 participants