TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pompom454/tea/llms.txt
Use this file to discover all available pages before exploring further.
Fullscreen API wraps the browser’s native Fullscreen API with a consistent interface for entering and exiting fullscreen mode, toggling it, querying its state, and attaching event handlers for change and error events. Because browser support varies, always check Fullscreen.isEnabled() before making a request.
Fullscreen.element
A getter that returns the element currently displayed in fullscreen mode, ornull if fullscreen is not active.
The current fullscreen element, or
null when not in fullscreen mode.Fullscreen.isEnabled()
Returns whether fullscreen mode is both supported by the browser and currently enabled (not blocked by permissions policy or other constraints).true if fullscreen is available, false otherwise.Fullscreen.isFullscreen()
Returns whether fullscreen mode is currently active.true if the browser is currently in fullscreen mode, false otherwise.Fullscreen.request()
Requests that the browser enter fullscreen mode. Returns aPromise that resolves when the browser has entered fullscreen, or rejects if the request fails.
A fullscreen options object. Pass
null or omit to use defaults.Controls the browser’s navigation UI in fullscreen. Valid values:
"auto"— no preference (browser decides)"hide"— request that navigation UI be hidden; full screen dimensions are used"show"— request that navigation UI be visible; element dimensions are clamped to leave room
The element to display in fullscreen. Defaults to the entire page when omitted.
A
Promise that resolves on success or rejects on failure.- Entire page
- Specific element
Fullscreen.exit()
Requests that the browser exit fullscreen mode. Returns aPromise that resolves once the browser has exited fullscreen.
A
Promise that resolves on success or rejects on failure.Fullscreen.toggle()
Requests that the browser toggle fullscreen mode: enters fullscreen if not active, exits if active. Returns aPromise.
A fullscreen options object. See
Fullscreen.request() for the full options reference.The element to use when entering fullscreen. Defaults to the entire page when omitted.
A
Promise that resolves on success or rejects on failure.- Entire page
- Specific element
Fullscreen.onChange()
Attaches a handler function for fullscreen change events. The handler is called whenever the browser enters or exits fullscreen mode.The function to invoke when the fullscreen state changes. Receives the event object as its argument.
The element to attach the handler to. Defaults to the document when omitted.
- Document-level handler
- Element-level handler
Fullscreen.offChange()
Removes fullscreen change event handlers previously attached withFullscreen.onChange().
The specific handler function to remove. If omitted, all change handlers are removed.
The element to remove the handler(s) from. Defaults to the document when omitted.
- Remove all handlers
- Remove specific handler
- From specific element
Fullscreen.onError()
Attaches a handler function for fullscreen error events, called when a fullscreen request or exit fails.The function to invoke when a fullscreen error occurs. Receives the event object as its argument.
The element to attach the handler to. Defaults to the document when omitted.
- Document-level handler
- Element-level handler
Fullscreen.offError()
Removes fullscreen error event handlers previously attached withFullscreen.onError().
The specific handler function to remove. If omitted, all error handlers are removed.
The element to remove the handler(s) from. Defaults to the document when omitted.
- Remove all handlers
- Remove specific handler
- From specific element
Fullscreen backgrounds
When using fullscreen mode with custom backgrounds, place background styles on thebody element rather than the html element.