Skip to content

Commit

Permalink
First try
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyza committed Nov 26, 2021
1 parent 5258aed commit cbdef30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ injectRendererModule({
const preloadData = ipcRenderer.sendSync("KERNEL_WINDOW_DATA");

// If context isolation is off, this should be patched to make sure everything complies.
if (!preloadData?.contextIsolation) {
contextBridge.exposeInMainWorld = (key, value) => window[key] = value;
if (!!preloadData?.windowOptions?.contextIsolation) {
contextBridge.exposeInMainWorld = function (key, value) {
console.log("aaaa", JSON.stringify(arguments));

window[key] = value;
};
}

if (preloadData?.originalPreload) {
Expand Down

0 comments on commit cbdef30

Please sign in to comment.