-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add Platform API and babel plugin #26
Conversation
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.
Thanks for your PR!
I left a few comments.
src/preload.ts
Outdated
platform, | ||
} | ||
|
||
try { |
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.
Why this change please?
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.
In our case, we implemented the node integration without context isolation.
So I add the auto fallback.
Or you suggest us refactor?
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.
My understanding is that context isolation is ennabled default in Electron now, I haven't seen docs about injecting globals when context isolation is disabled?
Basically, I don't want to rely on undefined Electron behavior for injecting these APIs. If the way you changed it is recommended or at least documented by Electron that's fine, but otherwise I'd rather only use the contextBridge
API.
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.
In my test. Disable the context isolation, contextBridge.exposeInMainWorld
will throw error.
Error: contextBridge API can only be used when contextIsolation is enabled
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.
Thanks for the changes!
As title.
In my case.
We need know which OS instead just
web
And considered #5 , I move it to
nativeOS