-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Automatically inject preload scripts #359
Conversation
getNameFallback is now only called from the main process minor change more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From both Electrons perspective and Slacks this is unsafe. We don't want JS written to disk and arbitrarily loaded without any form of validation, this bypasses gatekeeper and any other kind of signature validation.
IMO no tool or framework should make architectural decisions like this for apps by default, this kind of thing (if it had happened without us noticing) could cause untold security issues for downstream apps that the Sentry SDK might not consider but we definitely do.
Users no longer have to supply appName in any process
You can solve this using additionalArguments
in newly created webContents instead
No longer need to 'ping' the main process to check the SDK has been enabled
Can you provide more context on why this ping is needed? I might have alternatives to remove it
I posted this PR to the Electron Discord security channel specifically because I doubted it was a sensible thing to do!
I didn't know about The problem with It's probably simpler to just require passing
I think it is there mainly to improve developer experience. If the renderer cannot get an IPC response from the main process it logs a |
Closed in favour of #361 |
With this PR, we automatically inject the correct preload scripts via the Electron
session.setPreloads()
API.This has a number of advantages:
appName
in any processelectron
to externals (Renderer fails on 'fs' requirement #355)Disadvantages
session.setPreloads()
API was added in Electron v2 so that would become our minimum supported version (previously v1.8)preload scripts have to be available on disk which presents some issues if the main process is bundled. Currently preload scripts get transpiled to variables in code and are written touserData
directory at runtimesession.setPreloads()
API, they will likely overwrite our preload scripts. I've added a link to the docs where we can help users diagnose and fix the issues they may encounter.