I have a very simple background page for a Chrome extension:

```
chrome.runtime.onInstalled.addListener((reason) => {
  console.log(reason);
});

```

The background page runs when my extension is loaded:
[![enter image description here](https://i.stack.imgur.com/nvb2Z.png)](https://i.stack.imgur.com/nvb2Z.png)

The extension also has a popup that runs [getBackgroundPage()](https://developer.chrome.com/docs/extensions/reference/runtime/#method-getBackgroundPage), using:

```
const serviceWorkerWindow = await chrome.runtime.getBackgroundPage();

```

This fails with:

```
Uncaught (in promise) Error: You do not have a background page.

```

How do I make `getBackgroundPage()` work?