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
refactor: clean up webFrame implementation to use gin wrappers #28497
Conversation
66ec013
to
f69ac0d
Compare
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.
Deleted
lib/renderer/web-frame-init.ts
Outdated
// TODO(MarshallOfSound): Remove once the world-safe-execute-javascript deprecation warning is removed | ||
if (method.startsWith('executeJavaScript')) { | ||
return (webFrame as any)[`_${method}`](...args); | ||
} |
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.
do we want to keep this in for backportability?
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.
Removing this (the deprecation warning) makes the implementation easier. Need to figure out how best to handle this in older branches you're right
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.
I am removing this in #28456
ba0064a
to
c016240
Compare
@MarshallOfSound there are conflicts after my PR #28456 was merged |
The previous implementation of webFrame in the renderer process leaked sub-frame contexts and global objects across the context boundaries thus making it possible for apps to either maliciously or accidentally violate the contextIsolation boundary. This re-implementation binds all methods in native code directly to content::RenderFrame instances instead of relying on JS to provide a "window" with every method request. This is much more consistent with the rest of the Electron codebase and is substantially safer.
c016240
to
2d13f0b
Compare
No Release Notes |
The previous implementation of webFrame in the renderer process leaked sub-frame contexts and global objects across the context boundaries thus making it possible for apps to either maliciously or accidentally violate the contextIsolation boundary.
E.g.
electron.webFrame.top.context
leaked thewindow
object from the other side of the isolated world by accident (not by API, purely by implementation issues)This re-implementation binds all methods in native code directly to content::RenderFrame instances instead of relying on JS to provide a "window" with every method request. This is much more consistent with the rest of the Electron codebase and is substantially safer.
Notes: no-notes