function enableRemoteMainForRenderer({ existingWindow, windowConfig }) {
  let windowObj = existingWindow;

  if (!windowObj) {
    windowObj = new remote.BrowserWindow(windowConfig);

    const remoteMain = remote.require('@electron/remote/main');

    remoteMain.enable(windowObj.webContents);
  }

  return windowObj;
}
Enable remote main since it has been explicitly disabled by electron.