The Fullscreen API offers a JavaScript interface to add immersive experiences to your websites and web applications. When activated, fullscreen mode presents your content in center stage—extending over the entire screen—without the distractions of the browser and operating system UI.
Why go fullscreen?
Fullscreen mode improves user experience in a few critical ways:
- Focus: Eliminate distractions and draw attention to your content.
- Presentation: Present slideshows, videos, games, and other interactive experiences.
- Space: Maximize available screen real estate, especially useful on smaller devices.
- Additional keyboard shortcuts: Offer select keyboard shortcuts that are only available in fullscreen mode.
The Fullscreen API is widely supported across modern browsers and browser compatibility can be checked like so:
Implementing fullscreen the traditional way
Traditionally, entering fullscreen requires User Activation from a gesture, like a button click. That requirement is sensible in most cases, and generally aligns Fullscreen API use with user intent.
Example: Making a video fullscreen with a button
However, the user gesture requirement poses problems for sites that wish to open a new fullscreen window, make content fullscreen on multiple screens, or offer other immersive experiences.
Gesture-free fullscreen with a new permission
A new Chrome Enterprise feature supports more advanced Fullscreen API use cases, by offering permission controls for trusted sites to enter fullscreen without a user gesture.
Enterprise administrators can set a new AutomaticFullscreenAllowedForUrls policy, which grants this permission to trusted origins. Users are also able to grant a new Automatic Fullscreen permission through the site settings pages of Isolated Web Apps.
This feature is initially limited to enterprise-trusted sites and Isolated Web Apps. It may be available more broadly in the future.
Example: Checking for permission
Starting in Chrome 128, you can check if your site has permission to use the Fullscreen API without a user gesture.
Example: Opening a fullscreen popup
Sites with this permission are able to use more advanced windowing features, like opening a popup window and making it fullscreen on load.
Beyond the basics
Sites can combine progressive support for this new permission, Window Management API features, and settings to allow pop-ups without user gestures, to offer immersive multi-screen functionality that was not previously possible, like:
- Open a popup on another display and make it fullscreen with one user gesture.
- Show fullscreen content on multiple displays with one user gesture.
- Automatically extend a fullscreen content session onto a newly connected display.
These enlightened windowing experiences are particularly useful for advanced web applications like presentation suites, remote desktop clients, point-of-sale systems, financial dashboards, and medical imaging tools.
Development tips
Integrate new features using progressive enhancement to optimize browser, policy, permission, and user activation configurations. Useful practices include:
- Query for permissions with exception handling, to assess feature access.
- Handle promises, exceptions, and error events from the Fullscreen API.
- Examine validity and screen-space bounds of
window.open()
return values. - Inspect transient activation state with
navigator.userActivation.isActive
. - Feature-detect support for detailed screen information and presence of multiple screens.
- Check
window.location
forisolated-app:
schemes with user permission controls.
More resources
For more comprehensive resources and examples, reference these helpful links:
- HTML fullscreen without a gesture: Explainer, ChromeStatus, and example.
- Chrome Enterprise Policies: AutomaticFullscreen, and WindowManagement, Popups.
- MDN: Window Management, Fullscreen, UserActivation, Permissions, and
Window: open()
.