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: assign session to remote webContents #23989

Merged
merged 2 commits into from Jun 11, 2020
Merged

Conversation

sentialx
Copy link
Contributor

@sentialx sentialx commented Jun 5, 2020

Description of Change

This PR ensures that remote webContents (such as devtools and extension background pages) get initialized with session_ set.

Could this be backported to 9-x-y and 10-x-y, please?

Closes #23615
Ref #19447

Checklist

Release Notes

Notes: Fixed no session in webContents of type remote.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 5, 2020
@sentialx sentialx changed the title fix(extensions): background page webContents initialization fix: assign session and webPreferences to remote webContents Jun 5, 2020
@sentialx sentialx changed the title fix: assign session and webPreferences to remote webContents fix: assign session to remote webContents Jun 5, 2020
@sentialx sentialx marked this pull request as ready for review June 5, 2020 22:46
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 6, 2020
Copy link
Contributor

@stewartlord stewartlord 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 from here Eryk 🚀 👍 🏆

web_contents->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(
GetBrowserContext()->GetUserAgent()),
false);
Init(isolate);
AttachAsUserData(web_contents);
InitZoomController(web_contents, gin::Dictionary::CreateEmpty(isolate));

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: needless whitespace change (and another one below)

@zcbenz zcbenz merged commit 04be1ac into electron:master Jun 11, 2020
@release-clerk
Copy link

release-clerk bot commented Jun 11, 2020

Release Notes Persisted

Fixed no session in webContents of type remote.

@trop
Copy link
Contributor

trop bot commented Jun 11, 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 Jun 11, 2020

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

@trop
Copy link
Contributor

trop bot commented Jun 11, 2020

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

@sentialx sentialx deleted the fix-session branch June 12, 2020 15:38
sentialx added a commit to sentialx/electron that referenced this pull request Jul 30, 2020
* fix: assign session to remote webContents

* fix: test name
sentialx added a commit to sentialx/electron that referenced this pull request Apr 8, 2021
* fix: assign session to remote webContents

* fix: test name
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.

No webPreferences and session in e.sender received from an extension background page
4 participants