const { app, BrowserWindow } = require('electron');
const path = require('path');

// remote 有効化用
const remoteMain = require('@electron/remote/main');
remoteMain.initialize();

function createWindow() {
  const win = new BrowserWindow({
    width: 500,
    height: 600,
    resizable: false,
    icon: path.join(__dirname, 'EggTarutaru.ico'),
    frame: false, // タイトルバー非表示
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false, // remoteを使うためにfalse
    }
  });

  remoteMain.enable(win.webContents); // remote有効化
  win.setMenu(null);
  win.loadFile('index.html');
}

app.whenReady().then(createWindow);
