
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@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 healthy version release cadence and project activity because the last version was released less than 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.