refactor: port parts of window-setup to use ctx bridge instead of being run in the main world (#23194)
* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world * chore: update ctx bridge specs for new base numbers
This commit is contained in:
parent
9d60cfa6fc
commit
96bf9ce77f
5 changed files with 167 additions and 25 deletions
|
@ -18,3 +18,14 @@ const contextBridge = {
|
|||
if (!binding._debugGCMaps) delete contextBridge.debugGC;
|
||||
|
||||
export default contextBridge;
|
||||
|
||||
export const internalContextBridge = {
|
||||
contextIsolationEnabled,
|
||||
overrideGlobalMethodFromIsolatedWorld: (keys: string[], method: Function) => {
|
||||
return binding._overrideGlobalMethodFromIsolatedWorld(keys, method);
|
||||
},
|
||||
overrideGlobalPropertyFromIsolatedWorld: (keys: string[], getter: Function, setter?: Function) => {
|
||||
return binding._overrideGlobalPropertyFromIsolatedWorld(keys, getter, setter || null);
|
||||
},
|
||||
isInMainWorld: () => binding._isCalledFromMainWorld() as boolean
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue