text: const { app, BrowserWindow ,session} = require('electron')
  const url = require("url");
  const path = require("path");
  
  let win
  function createWindow() {
    // Create the browser window.
    win = new BrowserWindow({
      width: 800,
      height: 600,
      webPreferences: {
        nodeIntegration: true
        // devTools: false
      }
    })
  
    // and load the index.html of the app.
    win.loadURL(url.format({
      pathname: path.join(__dirname, `/dist/index.html`),
      protocol: 'file:',
      slashes: true
    }));
  
    // Open the DevTools.
    win.webContents.openDevTools()
  }
  
  // This method will be called when Electron has finished
  // initialization and is ready to create browser windows.
  // Some APIs can only be used after this event occurs.
  app.whenReady().then(createWindow)
  
  // Quit when all windows are closed, except on macOS. There, it's common
  // for applications and their menu bar to stay active until the user quits
  // explicitly with Cmd + Q.
  app.on('window-all-closed', () => {
    clearStroge();
    if (process.platform !== 'darwin') {
      app.quit()
    }
  })
  
  app.on('activate', () => {
    // On macOS it's common to re-create a window in the app when the
    // dock icon is clicked and there are no other windows open.
    if (BrowserWindow.getAllWindows().length === 0) {
      createWindow()
    }
  });
  function clearStroge(){
    session.defaultSession.clearStorageData({
      // without set origin options
      storages: ['localstorage', 'caches', 'indexdb']
    }, () => {
      // verify if storages got cleared.
      console.log('storage clear')
    })
  }
  