mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
refactor: clean up webFrame implementation to use gin wrappers (#28497)
* refactor: clean up webFrame implementation to use gin wrappers 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. * chore: un-re-order for ease of review * chore: pass isolate around instead of ErrorThrower * chore: fix rebase typo * chore: remove unused variables
This commit is contained in:
15
typings/internal-ambient.d.ts
vendored
15
typings/internal-ambient.d.ts
vendored
@@ -114,17 +114,12 @@ declare namespace NodeJS {
|
||||
webviewTag: boolean;
|
||||
}
|
||||
|
||||
interface InternalWebFrame extends Electron.WebFrame {
|
||||
getWebPreference<K extends keyof InternalWebPreferences>(name: K): InternalWebPreferences[K];
|
||||
}
|
||||
|
||||
interface WebFrameBinding {
|
||||
_findFrameByRoutingId(window: Window, routingId: number): Window;
|
||||
_getFrameForSelector(window: Window, selector: string): Window;
|
||||
_findFrameByName(window: Window, name: string): Window;
|
||||
_getOpener(window: Window): Window;
|
||||
_getParent(window: Window): Window;
|
||||
_getTop(window: Window): Window;
|
||||
_getFirstChild(window: Window): Window;
|
||||
_getNextSibling(window: Window): Window;
|
||||
_getRoutingId(window: Window): number;
|
||||
getWebPreference<K extends keyof InternalWebPreferences>(window: Window, name: K): InternalWebPreferences[K];
|
||||
mainFrame: InternalWebFrame;
|
||||
}
|
||||
|
||||
type DataPipe = {
|
||||
|
||||
Reference in New Issue
Block a user