It's going to be removed from Chromium, see https://crbug.com/812523.

/cc @electron/code-owners 
shell/browser/electron_javascript_dialog_manager.cc
int default_id = -1;
  int cancel_id = 0;
  std::vector<std::string> buttons = {"OK"};
  if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
    buttons.emplace_back("Cancel");
    
    default_id = 0;
    cancel_id = 1;
  }
  origin_counts_[origin]++;
  std::string checkbox;
  if (origin_counts_[origin] > 1 && web_preferences &&
      web_preferences->IsEnabled("safeDialogs") &&
      !web_preferences->GetPreference("safeDialogsMessage", &checkbox)) {
    checkbox = "Prevent this app from creating additional dialogs";
  }
  
  NativeWindow* window = nullptr;
  if (web_preferences && !web_preferences->IsEnabled(options::kOffscreen)) {
    auto* relay = NativeWindowRelay::FromWebContents(web_contents);
    if (relay)
      window = relay->GetNativeWindow();
  }
  electron::MessageBoxSettings settings;
  settings.parent_window = window;
  settings.checkbox_label = checkbox;
  settings.buttons = buttons;
  settings.default_id = default_id;
  settings.cancel_id = cancel_id;