0

In Electron Forge when I embed gmail and set nodeIntegrationInWorker: true I get a blank screen for Gmail. How do I fix this?

const createWindow = () => {
  const mainWindow = new BrowserWindow({

    webPreferences: {
       preload: path.join(__dirname, 'preload.js'),
       nodeIntegrationInWorker: true,
      contextIsolation: true
    },
  });

  mainWindow.loadURL("https://gmail.com")

};

I am using nodeIntegrationInWorker: true to manipulate the CSS of a site that requires gmail authentication. Without it, I can execute preload.js

EDIT

Reading about preload, it looks like I am using it incorrectly.

My goal is to create an app that manipulates the CSS of a website that uses gmail for authentication and to have the app persist those changes. I am writing dom manipulating JS in the preload.js file.

William
  • 4,422
  • 17
  • 55
  • 108
  • `preload.js` is there so you can provide JavaScript APIs to your HTML pages you're creating your app from, in the best case, it is even isolated from the DOM. I could see a solution if you'd embed GMail in an ` – Alexander Leithner Jan 08 '23 at 08:41

0 Answers0