Re-enable contextIsolation and sandboxing

Things will break, but let's try to fix them. In the current state, this is
preventing us from running `yarn dev` without reverting back to Electron 21.
This commit is contained in:
Manav Rathi 2024-03-13 13:16:47 +05:30
parent d83f9d0210
commit f29d9e1583
No known key found for this signature in database

View file

@ -8,7 +8,12 @@ import { getHideDockIconPreference } from "../services/userPreference";
import { isDev } from "./common";
import { isPlatform } from "./common/platform";
export async function createWindow(): Promise<BrowserWindow> {
/**
* Create an return the {@link BrowserWindow} that will form our app's UI.
*
* This window will show the HTML served from {@link rendererURL}.
*/
export const createWindow = async () => {
const appImgPath = isDev
? "resources/window-icon.png"
: path.join(process.resourcesPath, "window-icon.png");
@ -16,9 +21,7 @@ export async function createWindow(): Promise<BrowserWindow> {
// Create the browser window.
const mainWindow = new BrowserWindow({
webPreferences: {
sandbox: false,
preload: path.join(__dirname, "../preload.js"),
contextIsolation: false,
},
icon: appIcon,
show: false, // don't show the main window on load,
@ -114,4 +117,4 @@ export async function createWindow(): Promise<BrowserWindow> {
}
});
return mainWindow;
}
};