chore: clean up context bridge scopes and add specs for internal bridge (#23334)

* chore: clean up context bridge context scopes

* spec: add specs for internalContextBridge
This commit is contained in:
Samuel Attard 2020-05-11 13:41:42 -07:00 committed by GitHub
parent cf635c5fac
commit 7f9b7b2e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 269 additions and 121 deletions

View file

@ -19,6 +19,17 @@ declare namespace Electron {
setAppPath(path: string | null): void;
}
interface ContextBridge {
debugGC(): { functionCount: number }
internalContextBridge: {
contextIsolationEnabled: boolean;
overrideGlobalValueFromIsolatedWorld(keys: string[], value: any): void;
overrideGlobalValueWithDynamicPropsFromIsolatedWorld(keys: string[], value: any): void;
overrideGlobalPropertyFromIsolatedWorld(keys: string[], getter: Function, setter?: Function): void;
isInMainWorld(): boolean;
}
}
interface WebContents {
_getURL(): string;
getOwnerBrowserWindow(): Electron.BrowserWindow;