<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [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 for a feature request that matches the one I want to file, without success.

### Problem Description
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
app.dock.hide() crash on OS X Catalina when running as root #19896

### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
In macOS Catalina the dock.hide() will cause a crash when activated programmatically by root.
The same function works well on 10.14 and earlier versions.

Could we have an implementation as mentioned in  #19896, please?

```
// The application does not appear in the Dock and does not have a menu
// bar, but it may be activated programmatically or by clicking on one
// of its windows.
[NSApp setActivationPolicy: NSApplicationActivationPolicyAccessory];
```

### Alternatives Considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

### Additional Information
<!-- Add any other context about the problem here. -->
In my case the Electron app will be open via root from a package installer or LaunchDaemon, as subsequent processes will need to be run as root.
End users do not have admin rights and therefore any UI to request root access will not work.
As well as not showing in the Dock, the app will not have a menu bar too.

Thank you for considering this request.

shell/browser/api/electron_api_app.cc
#if defined(OS_LINUX)
  std::unique_ptr<base::Environment> env(base::Environment::Create());
  env->SetVar("CHROME_DESKTOP", desktop_name);
#endif
}
std::string App::GetLocale() {
  return g_browser_process->GetApplicationLocale();
}
std::string App::GetLocaleCountryCode() {
  std::string region;
#if defined(OS_WIN)
  WCHAR locale_name[LOCALE_NAME_MAX_LENGTH] = {0};
  if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME,
                      (LPWSTR)&locale_name,
                      sizeof(locale_name) / sizeof(WCHAR)) ||
      GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_SISO3166CTRYNAME,
                      (LPWSTR)&locale_name,
                      sizeof(locale_name) / sizeof(WCHAR))) {
    base::WideToUTF8(locale_name, wcslen(locale_name), &region);
  }
#elif defined(OS_MACOSX)
  CFLocaleRef locale = CFLocaleCopyCurrent();
  CFStringRef value = CFStringRef(
      static_cast<CFTypeRef>(CFLocaleGetValue(locale, kCFLocaleCountryCode)));
  const CFIndex kCStringSize = 128;