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: Inspector method overrides when contextIsolation enabled #29841

Merged
merged 3 commits into from Jun 24, 2021

Conversation

codebytere
Copy link
Member

Description of Change

Closes #29543.

Introduced with the default change from contextIsolation: false to contextIsolation: true. When contextIsolation is enabled, window.InspectorFrontendHost, window.Persistence, and window.UI are all undefined in the isolated world. We therefore need to set them with the contextBridge so that we can override them correctly.

Checklist

Release Notes

Notes: Fixed an issue where dropdown menus did not work in DevTools when contextIsolation was enabled.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/13-x-y labels Jun 22, 2021
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 22, 2021
@codebytere codebytere marked this pull request as draft June 22, 2021 13:00
@codebytere codebytere marked this pull request as ready for review June 22, 2021 14:58
@codebytere codebytere marked this pull request as draft June 22, 2021 14:59
@codebytere codebytere marked this pull request as ready for review June 22, 2021 15:10
lib/renderer/inspector.ts Outdated Show resolved Hide resolved
@codebytere codebytere requested a review from nornagon June 22, 2021 21:40
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

would also be good to check if we can remove the conditional in window.onload as well, to reduce the number of codepaths.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 23, 2021
@codebytere
Copy link
Member Author

Failure not germane - merging.

@codebytere codebytere merged commit 9b5dd53 into main Jun 24, 2021
@codebytere codebytere deleted the fix-inspector-overrides branch June 24, 2021 18:36
@release-clerk
Copy link

release-clerk bot commented Jun 24, 2021

Release Notes Persisted

Fixed an issue where dropdown menus did not work in DevTools when contextIsolation was enabled.

@trop
Copy link
Contributor

trop bot commented Jun 24, 2021

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

@trop
Copy link
Contributor

trop bot commented Jun 24, 2021

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

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]: Using setDevToolsWebContents results in DevTools window with no menu triggering
4 participants