window.addEventListener('DOMContentLoaded', () => {

  const { ipcRenderer, contextBridge } = require('electron')

  // アセットの返信受け取り
  ipcRenderer.on('ghostasset-reply', (event, arg) => {
    console.log(arg)
  })

  contextBridge.exposeInMainWorld("electron", {
    ipcRenderer: ipcRenderer
  });

  ipcRenderer.on('userinput-message', (event, arg) => {
    document.getElementById("balloon").dispatchEvent(new CustomEvent("say", {
      detail: {str: arg}
    }));
  })
})
