### 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
gin_helper::ErrorThrower(isolate).ThrowError(
        "Must pass valid certificate object.");
    return;
  }
  std::string data;
  if (!cert_data.Get("data", &data))
    return;
  auto certs = net::X509Certificate::CreateCertificateListFromBytes(
      base::as_bytes(base::make_span(data.c_str(), data.size())),
      net::X509Certificate::FORMAT_AUTO);
  if (!certs.empty()) {
    scoped_refptr<net::X509Certificate> cert(certs[0].get());
    for (auto& identity : *identities) {
      scoped_refptr<net::X509Certificate> identity_cert =
          identity->certificate();
      
      
      
      
      if (cert->EqualsExcludingChain(identity_cert.get())) {
        net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
            std::move(identity), base::BindRepeating(&GotPrivateKey, delegate,
                                                     std::move(identity_cert)));
        break;
      }
    }
  }
}
#if defined(USE_NSS_CERTS)
int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) {