> Documentation index: https://developer.chrome.com/blog/llms.txt

![Thomas Steiner](https://web.dev/images/authors/thomassteiner.jpg) Thomas Steiner [GitHub](https://github.com/tomayac) [LinkedIn](https://www.linkedin.com/in/thomassteinerlinkedin) [Mastodon](https://toot.cafe/@tomayac) [Bluesky](https://bsky.app/profile/tomayac.com) [Homepage](https://blog.tomayac.com/)

<br />

Imagine you want to open a popup window in fullscreen mode. Until now, opening a
fullscreen popup window consisted of two steps:

1. From the main app window, calling the [`window.open()`](https://developer.mozilla.org/docs/Web/API/Window/open) method that requires a user gesture like the click on an **Open popup
   window** button.
2. From the popup window, calling the [`Element.requestFullscreen()`](https://developer.mozilla.org/es/docs/Web/API/Element/requestFullscreen) method, which likewise requires a user gesture like the click on an **Enter
   fullscreen mode** button.

There's now a new
[origin trial](https://developer.chrome.com/docs/web-platform/origin-trials.md.txt)
available running from Chrome 119 (stable date):


October 31, 2023 to Chrome
122 (stable date):


October 31, 2023 for opening popup windows in fullscreen
mode with just one step. Click **Register** on the
[Open popups as fullscreen windows](https://developer.chrome.com/origintrials#/view_trial/106960491150049281)
origin trial landing page to sign up.
Apart from the origin trial, you can also test locally
by setting the `chrome://flags/#fullscreen-popup-windows` flag to **Enabled**.

## Opening fullscreen popup windows on the current screen

This new feature is gated behind the
[`window-management`](https://developer.chrome.com/articles/window-management#the-window-management-permission)
permission. Once the user has granted the permission, you can open a fullscreen
popup window as in the following example.

```javascript
document.querySelector('.fullscreen-popoup-button').addEventListener('click', async (e) => {
  if ((await navigator.permissions.query({name: 'window-management'})).state !== 'granted') {
    // Permission not granted. Call `window.getScreenDetails()` to prompt.
    await window.getScreenDetails();
  }
  // Permission granted. Open the fullscreen popup window.
  window.open('https://example.com/popup.html', '_blank', 'popup,fullscreen');
});
```

In the last line of the code sample, the first parameter is the
[`url`](https://developer.mozilla.org/docs/Web/API/Window/open#url) to
open in the popup window. The second parameter is the
[`target`](https://developer.mozilla.org/docs/Web/API/Window/open#target),
with the special value of
[`_blank`](https://developer.mozilla.org/docs/Web/HTML/Element/a#target).
The third parameter is for the
[`windowFeatures`](https://developer.mozilla.org/docs/Web/API/Window/open#windowfeatures),
a comma-separated string with the value
[`popup`](https://developer.mozilla.org/docs/Web/API/Window/open) for
opening a popup window and the new value `fullscreen` for opening the popup
window in fullscreen mode. This works with just one user gesture, therefore can
be activated with a single click on a button.

## Opening fullscreen popup windows on other screens

This feature really shines in combination with the
[Window Management API](https://developer.chrome.com/articles/window-management)
which lets you obtain information about all the screens the user has connected
to their computer. For example, to open a fullscreen popup window on another
screen than the user's current screen, you need to first
[find the other screen](https://developer.chrome.com/articles/window-management#the-getscreendetails-method)
and then pass its `availLeft`, `availTop`, `availWidth`, and `availHeight`
values to the corresponding `left`, `top`, `width`, and `height` values of the
`windowFeatures` string.

```javascript

document.querySelector(&#39;.fullscreen-popoup-button-other-screen&#39;).addEventListener(&#39;click&#39;, async (e) =&gt; {
  const screenDetails = await window.getScreenDetails();
  ​​const otherScreen = screenDetails.screens.find(s =&gt; s !== screenDetails.currentScreen);
  window.open(&#39;https://example.com/popup.html&#39;, &#39;_blank&#39;, `left=${otherScreen.availLeft},` +
      `top=${otherScreen.availTop},` +
      `width=${otherScreen.availWidth},` +
      `height=${otherScreen.availHeight},` +
      `fullscreen`);
});

```

> [!NOTE]
> **Note:** It's not required to add `popup` in the `windowFeatures` strings here, as it's implicitly assumed when any of `left`, `top`, `width`, or `height` is defined.

## Demo

Try fullscreen popup windows in the
[demo](https://michaelwasserman.github.io/window-placement-demo/) and
[view the source code](https://github.com/michaelwasserman/window-placement-demo/).
Be sure to check the **fullscreen** checkbox and the **Fullscreen popup** button, and,
if you have the opportunity, play with the demo with multiple screens attached to
your device.
<iframe src="https://michaelwasserman.github.io/window-placement-demo/" style="width: 100%; height: 800px;" allow="window-management;fullscreen"></iframe>

## Related links

- [Public explainer](https://github.com/w3c/window-management/blob/main/EXPLAINER_fullscreen_popups.md)
- [ChromeStatus entry](https://chromestatus.com/feature/6002307972464640)
- [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1142516)
- [TAG review](https://github.com/w3ctag/design-reviews/issues/840)
- [Mozilla standards position](https://github.com/mozilla/standards-positions/issues/714)
- [WebKit standards position](https://github.com/WebKit/standards-positions/issues/101)

## Acknowledgements

This article was reviewed by [Brad Triebwasser](https://www.linkedin.com/in/bradtriebwasser), [Hakan Isbiliroglu](https://www.linkedin.com/in/hakan-isbiliroglu),
[Mike Wasserman](https://www.linkedin.com/in/mike-wasserman), and [Rachel Andrew](https://rachelandrew.co.uk/).