Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-fullscreen

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-fullscreen

fullscreen api in a vendor agnostic wrapper

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

easy-fullscreen: Fullscreen API wrapper

API and Usage

import Fullscreen from 'easy-fullscreen';

var fullscreenElement = doucument.getElementById('fullscreen-container');
var fullscreenButton = document.getElementById('button');

// check if fullscreen enabled
if (Fullscreen.isEnabled) {
  fullscreenButton.onclick = function () {
    check if is in fullscreen mode
    if (Fullscreen.isFullscreen) {
      // exit fullscreen
      Fullscreen.exit();
    } else {
      // request to enter fullscreen
      Fullscreen.request(fullscreenElement);
    }
  };
}


var onChangeHandler = function () {
  if (Fullscreen.isFullscreen) {
    console.log('Entered fullscreen');
  } else {
    console.log('Exited fullscreen');
  }
};

// subscribe to fullscreen change event
Fullscreen.on('change', onChangeHandler);

// unsubscribe from fullscreen change event
Fullscreen.off('change', onChangeHandler);

var onErrorHandler = function (e) {
  console.log(e);
};

// subscribe to fullscreen error event
Fullscreen.on('error', onErrorHandler);

// unsubscribe from fullscreen error event
Fullscreen.off('error', onErrorHandler);

FAQs

Package last updated on 06 Nov 2017

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