<commit_before>const { app, BrowserWindow, globalShortcut } = require('electron')
const { resolve } = require('path')

let win = null
let proxy = null

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('ready', () => {
  win = new BrowserWindow({width: 640, height: 800, titleBarStyle: 'hidden-inset'})
  win.loadURL('file://' + resolve(__dirname, 'renderer/index.html'))

  proxy = new BrowserWindow({width: 400, height: 400, show: false})
  proxy.loadURL('file://' + resolve(__dirname, 'proxy.html'))

  proxy.on('ready-to-show', () => {
    proxy.webContents.send('start-proxy', win.id)
  })

  globalShortcut.register('f12', () => {
    win.toggleDevTools()
  })

  win.on('closed', () => {
    win = null
  })

  proxy.on('closed', () => {
    proxy = null
  })
})<commit_msg>Listen for crash event on renderers.<commit_after>const { app, BrowserWindow, globalShortcut } = require('electron')
const { resolve } = require('path')

let win = null
let proxy = null

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('ready', () => {
  win = new BrowserWindow({width: 640, height: 800, titleBarStyle: 'hidden-inset'})
  win.loadURL('file://' + resolve(__dirname, 'renderer/index.html'))

  proxy = new BrowserWindow({width: 400, height: 400, show: false})
  proxy.loadURL('file://' + resolve(__dirname, 'proxy.html'))

  proxy.on('ready-to-show', () => {
    proxy.webContents.send('start-proxy', win.id)
  })

  globalShortcut.register('f12', () => {
    win.toggleDevTools()
  })

  win.on('closed', () => {
    win = null
    console.log('Gui window closed...')
  })

  win.webContents.on('crashed', (evt, killed) => {
    console.log('Gui window crashed...')
  })

  proxy.webContents.on('crashed', (evt, killed) => {
    console.log('Proxy window crashed...')
  })

  proxy.on('closed', () => {
    proxy = null
  })
})
{'fraction_non_alphanumeric': 0.21136950904392765, 'fraction_numerical': 0.014470284237726097, 'mean_word_length': 3.6315789473684212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2674412', 'n_tokens_mistral': 700, 'n_tokens_neox': 656, 'n_words': 126}