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

No webPreferences and session in e.sender received from an extension background page #23615

Closed
3 tasks done
sentialx opened this issue May 15, 2020 · 1 comment · Fixed by #23989
Closed
3 tasks done

Comments

@sentialx
Copy link
Contributor

sentialx commented May 15, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Ref #19447

Issue Details

  • Electron Version:
    • 9.0.0-beta.24
  • Operating System:
    • macOS 10.15, Windows 10
  • Last Known Working Electron version:
    • none

Expected Behavior

e.sender object received from an extension background page should have webPreferences and session initialized. It looks like options in api::WebContents constructor don't get initialized properly for an extension background page.

Actual Behavior

e.sender object doesn't have session and e.sender.getWebPreferences() returns null.

To Reproduce

https://github.com/sentialx/electron-quick-start/tree/extensions/no-session

Just run it and you will see something like this:
image

Additional Information

This is a real blocker for anyone who would want to provide own chrome APIs in background pages initialized from different sessions.

@nornagon
Copy link
Member

nornagon commented Jun 4, 2020

Seems like this constructor isn't setting the session_ variable, so maybe that's the issue?

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 a pull request may close this issue.

2 participants