Socket
Socket
Sign inDemoInstall

fscreen

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fscreen

Vendor agnostic access to the fullscreen spec api


Version published
Weekly downloads
170K
decreased by-4.33%
Maintainers
1
Weekly downloads
 
Created

What is fscreen?

The fscreen npm package provides a simple and consistent API for working with the Fullscreen API across different browsers. It allows developers to easily request fullscreen mode, exit fullscreen mode, and handle fullscreen change events.

What are fscreen's main functionalities?

Request Fullscreen

This feature allows you to request fullscreen mode for a specific element. In this example, clicking anywhere on the document will request fullscreen mode for the entire document.

document.addEventListener('click', () => {
  fscreen.requestFullscreen(document.documentElement);
});

Exit Fullscreen

This feature allows you to exit fullscreen mode. In this example, pressing the 'Escape' key will exit fullscreen mode.

document.addEventListener('keydown', (event) => {
  if (event.key === 'Escape') {
    fscreen.exitFullscreen();
  }
});

Fullscreen Change Event

This feature allows you to handle fullscreen change events. In this example, a message is logged to the console whenever the fullscreen mode is entered or exited.

fscreen.addEventListener('fullscreenchange', () => {
  if (fscreen.fullscreenElement) {
    console.log('Entered fullscreen mode');
  } else {
    console.log('Exited fullscreen mode');
  }
});

Other packages similar to fscreen

Keywords

FAQs

Package last updated on 11 Feb 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc