### 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 (Browser::Get()->is_ready()) {
    thrower.ThrowError(
        "app.enableSandbox() can only be called "
        "before app is ready");
    return;
  }
  auto* command_line = base::CommandLine::ForCurrentProcess();
  RemoveNoSandboxSwitch(command_line);
  command_line->AppendSwitch(switches::kEnableSandbox);
}
void App::SetUserAgentFallback(const std::string& user_agent) {
  ElectronBrowserClient::Get()->SetUserAgent(user_agent);
}
#if defined(OS_WIN)
bool App::IsRunningUnderARM64Translation() const {
  USHORT processMachine = 0;
  USHORT nativeMachine = 0;
  auto IsWow64Process2 = reinterpret_cast<decltype(&::IsWow64Process2)>(
      GetProcAddress(GetModuleHandle(L"kernel32.dll"), "IsWow64Process2"));
  if (IsWow64Process2 == nullptr) {
    return false;
  }
  if (!IsWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine)) {
    return false;
  }
  return nativeMachine == IMAGE_FILE_MACHINE_ARM64;
}
#endif
std::string App::GetUserAgentFallback() {