feat: add exposeInIsolatedWorld(worldId, key, api) to contextBridge (#34974)

* feat: add exposeInIsolatedWorld(worldId, key, api) to contextBridge

* Updates exposeInIslatedWorld worldId documentation
This commit is contained in:
Akshay Deo 2022-09-21 23:47:10 +05:30 committed by GitHub
parent 8c3c0f0b50
commit dfc134de42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 95 additions and 21 deletions

View file

@ -7,7 +7,11 @@ const checkContextIsolationEnabled = () => {
const contextBridge: Electron.ContextBridge = {
exposeInMainWorld: (key: string, api: any) => {
checkContextIsolationEnabled();
return binding.exposeAPIInMainWorld(key, api);
return binding.exposeAPIInWorld(0, key, api);
},
exposeInIsolatedWorld: (worldId: number, key: string, api: any) => {
checkContextIsolationEnabled();
return binding.exposeAPIInWorld(worldId, key, api);
}
};