### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

We need to load a custom error page when the certificate is invalid but without "isMainFrame" property we don't know when to load the custom error page using webContents.loadURL()

### Proposed Solution

webContents.on("certificate-error", ((event, url, error, certificate, callback, isMainFrame)

### Alternatives Considered

Not sure

### Additional Information

Not sure
shell/browser/api/electron_api_app.cc
return v8::Local<v8::Value>::New(isolate, dock_);
}
#endif
void ConfigureHostResolver(v8::Isolate* isolate,
                           const gin_helper::Dictionary& opts) {
  gin_helper::ErrorThrower thrower(isolate);
  net::SecureDnsMode secure_dns_mode = net::SecureDnsMode::kOff;
  std::string default_doh_templates;
  if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
    if (features::kDnsOverHttpsFallbackParam.Get()) {
      secure_dns_mode = net::SecureDnsMode::kAutomatic;
    } else {
      secure_dns_mode = net::SecureDnsMode::kSecure;
    }
    default_doh_templates = features::kDnsOverHttpsTemplatesParam.Get();
  }
  std::string server_method;
  std::vector<net::DnsOverHttpsServerConfig> dns_over_https_servers;
  absl::optional<std::vector<network::mojom::DnsOverHttpsServerPtr>>
      servers_mojo;
  if (!default_doh_templates.empty() &&
      secure_dns_mode != net::SecureDnsMode::kOff) {
    for (base::StringPiece server_template :
         SplitStringPiece(default_doh_templates, " ", base::TRIM_WHITESPACE,
                          base::SPLIT_WANT_NONEMPTY)) {
      if (!net::dns_util::IsValidDohTemplate(server_template, &server_method)) {
        continue;
      }
      bool use_post = server_method == "POST";
      dns_over_https_servers.emplace_back(std::string(server_template),