
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@cmchu/screen-full
Advanced tools
This module provides a straightforward set of APIs to control the browser's fullscreen functionality and listen for changes and errors in the fullscreen state. By encapsulating the native fullscreen APIs, it enables developers to uniformly handle fullscre
This module provides a straightforward set of APIs to control the browser's fullscreen functionality and listen for changes and errors in the fullscreen state. By encapsulating the native fullscreen APIs, it enables developers to uniformly handle fullscreen operations across different browsers.
Install using npm or yarn:
npm install @cmchu/screen-full
# or
yarn add @cmchu/screen-full
First, import the screenfull module into your project.
import screenfull from '@cmchu/screen-full';
Check & Request Fullscreen
screenfull.isEnabled: Checks if the current browser supports fullscreen mode.screenfull.isFullscreen: Checks if the current page is in fullscreen.screenfull.request() or screenfull.requestFullscreen(element?, options?): Requests to make an element fullscreen. If no element is specified, it attempts to make the entire document fullscreen by default.Exit Fullscreen
screenfull.exit() or screenfull.exitFullscreen(element?): Exits fullscreen mode. If no element is specified, it attempts to exit the current fullscreen element.Event Listening
screenfull.onChange(callback) or screenfull.fullscreenchange(callback): Listens for changes in the fullscreen state.screenfull.onError(callback) or screenfull.fullscreenerror(callback): Listens for fullscreen errors.Get Fullscreen Element
screenfull.fullElement: Retrieves the current fullscreen element.F11 and Esc keys to implement one-click fullscreen entry/exit functionality.F11 and Esc keys.F11 and Esc shortcut keys. Modify or remove this logic as per your application's needs.import screenfull from '@cmchu/screen-full';
if (screenfull.isEnabled) {
screenfull.request(); // Enter fullscreen
screenfull.onChange(() => { // Listen for fullscreen state changes
if (screenfull.isFullscreen) {
console.log("Entered fullscreen");
} else {
console.log("Exited fullscreen");
}
});
} else {
console.log("Your browser does not support the fullscreen API.");
}
This code example is licensed under the MIT License. Please adhere to the terms of relevant open-source licenses when using it.
FAQs
This module provides a straightforward set of APIs to control the browser's fullscreen functionality and listen for changes and errors in the fullscreen state. By encapsulating the native fullscreen APIs, it enables developers to uniformly handle fullscre
We found that @cmchu/screen-full demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.