### 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
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER, host->GetID(),
                       host->GetProcess().Handle());
}
void App::RenderProcessExited(content::RenderProcessHost* host) {
  ChildProcessDisconnected(host->GetID());
}
void App::ChildProcessLaunched(int process_type,
                               int pid,
                               base::ProcessHandle handle,
                               const std::string& service_name,
                               const std::string& name) {
#if defined(OS_MAC)
  auto metrics = base::ProcessMetrics::CreateProcessMetrics(
      handle, content::BrowserChildProcessHost::GetPortProvider());
#else
  auto metrics = base::ProcessMetrics::CreateProcessMetrics(handle);
#endif
  app_metrics_[pid] = std::make_unique<electron::ProcessMetric>(
      process_type, handle, std::move(metrics), service_name, name);
}
void App::ChildProcessDisconnected(int pid) {
  app_metrics_.erase(pid);
}
base::FilePath App::GetAppPath() const {