### 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;
    }
    servers_mojo = absl::nullopt;
    for (const std::string& server_template : secure_dns_server_strings) {
      std::string server_method;
      if (!net::dns_util::IsValidDohTemplate(server_template, &server_method)) {
        thrower.ThrowTypeError(std::string("not a valid DoH template: ") +
                               server_template);
        return;
      }
      bool use_post = server_method == "POST";
      if (!servers_mojo.has_value()) {
        servers_mojo = absl::make_optional<
            std::vector<network::mojom::DnsOverHttpsServerPtr>>();
      }
      network::mojom::DnsOverHttpsServerPtr server_mojo =
          network::mojom::DnsOverHttpsServer::New();
      server_mojo->server_template = std::string(server_template);
      server_mojo->use_post = use_post;
      servers_mojo->emplace_back(std::move(server_mojo));
    }
  }
  if (opts.Has("enableAdditionalDnsQueryTypes") &&
      !opts.Get("enableAdditionalDnsQueryTypes",
                &additional_dns_query_types_enabled)) {
    thrower.ThrowTypeError("enableAdditionalDnsQueryTypes must be a boolean");
    return;
  }