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(extensions): devtools now open for background pages #22217

Merged
merged 1 commit into from Sep 8, 2020

Conversation

samuelmaddock
Copy link
Member

@samuelmaddock samuelmaddock commented Feb 17, 2020

Description of Change

Ref #19447

This fixes DevTools not opening with Chrome extension background pages.

  • Assign WebContents type based on ViewType user data.
  • Manage background page WebContents to enable opening devtools.

Electron maintainers, please add 9-x-y backport label.

TODO:

  • Fix ExtensionHost crash on shutdown; likely related to managed_web_contents deleting WebContents instance.
  • Fix crashes? or is it just flaky tests?

Checklist

Release Notes

Notes: no-notes

@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels Feb 17, 2020
@samuelmaddock samuelmaddock marked this pull request as ready for review March 2, 2020 17:39
@samuelmaddock samuelmaddock changed the title [wip] fix(extensions): devtools now open for background pages fix(extensions): devtools now open for background pages Mar 2, 2020
Copy link
Member

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@samuelmaddock samuelmaddock changed the title fix(extensions): devtools now open for background pages [wip] fix(extensions): devtools now open for background pages Mar 6, 2020
@samuelmaddock samuelmaddock force-pushed the fix-bgpage-devtools branch 2 times, most recently from 6d2a859 to da5464e Compare March 7, 2020 00:02
@zcbenz zcbenz added the wip ⚒ label Mar 20, 2020
@sentialx
Copy link
Contributor

Is there any chance that it could be merged?

refactor(extensions): remove unused InitWithBrowserContext method

fix(extensions): release background page WebContents to avoid crash

The background page WebContents instance is managed by the ExtensionHost.

fix(extensions): open background page devtools detached by default

test(extensions): add background page devtools test

chore: test fix for null web_contents()

fix: close background page devtools in test after opening
@samuelmaddock samuelmaddock changed the title [wip] fix(extensions): devtools now open for background pages fix(extensions): devtools now open for background pages Sep 6, 2020
@samuelmaddock
Copy link
Member Author

@zcbenz I fixed this up so it's no longer a WIP, the label can be removed now.

@zcbenz zcbenz removed the wip ⚒ label Sep 8, 2020
@zcbenz zcbenz merged commit 5a8046c into electron:master Sep 8, 2020
@release-clerk
Copy link

release-clerk bot commented Sep 8, 2020

No Release Notes

@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

I was unable to backport this PR to "10-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/10-x-y label Sep 8, 2020
@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

I was unable to backport this PR to "9-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

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

@codebytere
Copy link
Member

@samuelmaddock could you do backports for this?

samuelmaddock added a commit to samuelmaddock/electron that referenced this pull request Sep 22, 2020
refactor(extensions): remove unused InitWithBrowserContext method

fix(extensions): release background page WebContents to avoid crash

The background page WebContents instance is managed by the ExtensionHost.

fix(extensions): open background page devtools detached by default

test(extensions): add background page devtools test

chore: test fix for null web_contents()

fix: close background page devtools in test after opening
samuelmaddock added a commit to samuelmaddock/electron that referenced this pull request Sep 22, 2020
refactor(extensions): remove unused InitWithBrowserContext method

fix(extensions): release background page WebContents to avoid crash

The background page WebContents instance is managed by the ExtensionHost.

fix(extensions): open background page devtools detached by default

test(extensions): add background page devtools test

chore: test fix for null web_contents()

fix: close background page devtools in test after opening
@trop
Copy link
Contributor

trop bot commented Sep 22, 2020

@samuelmaddock has manually backported this PR to "10-x-y", please check out #25566

@trop
Copy link
Contributor

trop bot commented Sep 22, 2020

@samuelmaddock has manually backported this PR to "9-x-y", please check out #25567

@samuelmaddock samuelmaddock deleted the fix-bgpage-devtools branch September 22, 2020 04:04
@samuelmaddock
Copy link
Member Author

@codebytere done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants