cef.on("browser_open", () => {

window.addEventListener("keydown", (event) => {
    // если нажали ESC 
    if (is_esc_pressed(event)) { 
      cef.hide(true);
      cef.set_focused(false);
    }
  });
});