### 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
if (HasSingleInstanceLock())
    return true;
  std::string program_name = electron::Browser::Get()->GetName();
  base::FilePath user_dir;
  base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
  auto cb = base::BindRepeating(&App::OnSecondInstance, base::Unretained(this));
#if defined(OS_WIN)
  bool app_is_sandboxed =
      IsSandboxEnabled(base::CommandLine::ForCurrentProcess());
  process_singleton_ = std::make_unique<ProcessSingleton>(
      program_name, user_dir, app_is_sandboxed,
      base::BindRepeating(NotificationCallbackWrapper, cb));
#else
  process_singleton_ = std::make_unique<ProcessSingleton>(
      user_dir, base::BindRepeating(NotificationCallbackWrapper, cb));
#endif
  switch (process_singleton_->NotifyOtherProcessOrCreate()) {
    case ProcessSingleton::NotifyResult::LOCK_ERROR:
    case ProcessSingleton::NotifyResult::PROFILE_IN_USE:
    case ProcessSingleton::NotifyResult::PROCESS_NOTIFIED: {
      process_singleton_.reset();
      return false;
    }
    case ProcessSingleton::NotifyResult::PROCESS_NONE:
    default:  
      return true;
  }
}
void App::ReleaseSingleInstanceLock() {