enterFullScreen
Category: Application Control
Namespace: web.app.enterFullScreen
Description
Enter fullscreen mode with no window borders, title bar, or taskbar visible. The application takes over the entire screen, providing an immersive experience ideal for presentations, games, or media viewing.
Syntax
await web.app.enterFullScreen();
Parameters
None
Returns
Promise<boolean> - Returns true when fullscreen mode is activated
Example
Simple example
await web.app.enterFullScreen();
Practical example
document.getElementById('fullscreen-btn').addEventListener('click', async () => {
await web.app.enterFullScreen();
});
Advanced example
document.addEventListener('keydown', async (event) => {
if (event.key === 'F11') {
event.preventDefault();
const isFullscreen = await web.app.isFullScreen();
if (isFullscreen) {
await web.app.exitFullScreen();
} else {
await web.app.enterFullScreen();
}
}
});
Use Cases
- Create presentation mode for slideshows
- Fullscreen mode for video playback
- Immersive gaming experience
- Distraction-free writing or reading mode
- Kiosk mode for public displays
- Photo viewing in fullscreen
- Dashboard displays without borders
- F11 keyboard shortcut implementation
Error Handling
This method does not throw errors. If already in fullscreen, calling this method has no effect.
Performance Tips
- Provide clear exit instructions (ESC key, button)
- Check fullscreen status before entering
- Save window state before entering fullscreen
- Consider showing fullscreen indicator
- Use
isFullScreen()to track state
Related Methods
web.app.exitFullScreen()- Exit fullscreen modeweb.app.isFullScreen()- Check if in fullscreenweb.app.windowMaximize()- Maximize with bordersweb.app.windowRestore()- Restore normal size
Notes
- Hides all window decorations (title bar, borders, taskbar)
- Different from maximize (which keeps borders)
- Press ESC key to exit fullscreen (standard behavior)
- Ideal for presentations and media viewing
- Window returns to previous state when exiting