### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/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.

### Electron Version

15.0.2

### What operating system are you using?

macOS

### Operating System Version

macOS

### What arch are you using?

x64

### Last Known Working Electron version

13

### Expected Behavior

I updated my electron version to v15.0.2 but noticed that Metadata is not working anymore....

```js
    window.navigator.mediaSession.metadata = new window.MediaMetadata(metadata);
```
NOTE: it was working on v13.0.1

### Actual Behavior

.

### Testcase Gist URL

_No response_

### Additional Information

.
shell/browser/api/electron_api_global_shortcut.cc
#include "shell/browser/api/electron_api_global_shortcut.h"
#include <vector>
#include "base/containers/contains.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "gin/dictionary.h"
#include "gin/object_template_builder.h"
#include "shell/browser/api/electron_api_system_preferences.h"
#include "shell/browser/browser.h"
#include "shell/common/gin_converters/accelerator_converter.h"
#include "shell/common/gin_converters/callback_converter.h"
#include "shell/common/node_includes.h"
#if defined(OS_MAC)
#include "base/mac/mac_util.h"
#endif
using extensions::GlobalShortcutListener;
namespace {
#if defined(OS_MAC)
bool RegisteringMediaKeyForUntrustedClient(const ui::Accelerator& accelerator) {