const BrowserWindow = require("electron").BrowserWindow;
const { app } = require("electron");

app.commandLine.appendSwitch('max-active-webgl-contexts','128');

if(process.platform == 'win32')
  process.env['VLC_PLUGIN_PATH'] = require('path').join(__dirname, 'node_modules/webchimera.js/plugins');

// app.allowRendererProcessReuse = false;

app.on("ready", async function() {
  var win = new BrowserWindow({
    show: false,
    frame:false,
    transparent: true,
    resizable: false,
    devTools: true,
    webPreferences: {
      webviewTag:true,
      nodeIntegration: true,
      enableRemoteModule: true,
      contextIsolation: false,
    },
  });

  // win.toggleDevTools();

  win.loadURL(`file://${__dirname}/dist/index.html`);
  win.on('ready-to-show', () => {
    win.setPosition(0, 0);
    win.show();
    win.maximize();
    win.focus();
  });

  win.on('close', () => {
    app.quit();
  });

});