npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

full-screen-helper

v1.0.6

Published

The full-screen-helper.js is a cross-browser lib that provides an easy way for web content to be presented using the user's entire screen (support for jQuery, however is optional)

Downloads

14

Readme

Full Screen Helper

Setup

Include lib

<script src="full-screen-helper.min.js"></script>

Or use CDN:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/full-screen-helper.min.js"></script>

Import:

const FullScreenHelper = require('full-screen-helper');

Import ES6 (eg.: "libs" like Angular/Vue-cli):

import FullScreenHelper from 'full-screen-helper'

RequireJS:

requirejs(['folder/foo/bar/full-screen-helper'], function (FullScreenHelper) {
    ...
});

Browser support

Tested in:

  • IE8+ (using ActiveX)
  • IE11 (without ActiveX)
  • Firefox
  • Google Chrome

Note¹: for security reasons maybe WScript.shell (ActiveX) may be blocked.

Note²: Mobile browsers using fallback (full-viewport)

Usage

For use an video in fullscreen:

<video id="myVideo" src="video.webm"></video>

<button onclick="$('#myVideo').fullScreenHelper('request');">Fullscreen</button>

For use an video in fullscreen (Vanilla.js :P):

<video id="myVideo" src="video.webm"></video>

<button onclick="FullScreenHelper.request('#myVideo');">Fullscreen</button>

or

var element = document.getElementById('myVideo');

...

FullScreenHelper.request(element);

Entire page in fullscreen:

<button onclick="FullScreenHelper.request();">Fullscreen</button>
<button onclick="$('body').fullScreenHelper('request');">Fullscreen</button>

API

Method | Description --- | --- FullScreenHelper.supported() | Return true if browser support fullscreen, otherwise return false FullScreenHelper.state() | Return true if in fullscreen, otherwise return false FullScreenHelper.viewport(boolean) | If define true use fullviewport as fallback to browsers without support to fullscreen. Default is true FullScreenHelper.request(element\|selector) | Show element in fullscreen, if there is not another one on fullscreen FullScreenHelper.toggle(element\|selector) | Put the element in fullscreen or restore FullScreenHelper.exit() | Exit fullscreen mode FullScreenHelper.current() | Get current element in fullscreen, otherwise returns null FullScreenHelper.on(function () {}) | Add event FullScreenHelper.off(function () {}) | Remove event

jQuery fullscreen API

Method | Equivalent --- | --- $(':fullscreen') | FullScreenHelper.current() $('...').fullScreenHelper('request') | FullScreenHelper.request(element\|selector) $('...').fullScreenHelper('toggle') | FullScreenHelper.toggle(element\|selector) $('body').fullScreenHelper('request') | FullScreenHelper.request() $('body').fullScreenHelper('toggle') | FullScreenHelper.toggle() $(document).bind('fullscreenchange', function () {}) | FullScreenHelper.on(function () {}) $(document).unbind('fullscreenchange', function () {}) | FullScreenHelper.off(function () {}) $.fullScreenHelper('supported') | FullScreenHelper.supported() $.fullScreenHelper('state') | FullScreenHelper.state() $.fullScreenHelper('exit') | FullScreenHelper.exit()

Note ¹: 'request' is optional in $('...').fullScreenHelper('request'), you can use $('...').fullScreenHelper()

Note ²: You can use $('body') or $(document) in .fullScreenHelper('toggle') and .fullScreenHelper('request')

Fullscreen in Internet Explorer

For support in older MSIE browser is needed WScript.Shell activex, but in IE8+ security has been increased, which can cause the script to not work.

For MSIE11 is used msRequestFullscreen and msExitFullscreen

Note: It is recommended that you use:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

CSS selector

Use combined CSS selectors with prefix don't work, because when there is an invalid selector the whole rule dropped, if grouped (details: https://www.w3.org/TR/selectors4/#logical-combination):

:fullscreen,
:full-screen,
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen {
    /* your custom css */
}

When the selectors are not grouped, only invalids (depends on the browser) rules are dropped, example:

/* dropped in older browsers */
:fullscreen {
    /* your custom css */
}

/* dropped in new browsers */
:full-screen {
    /* your custom css */
}

/* dropped in all browsers except Safari, Chrome and others with webkit */
:-webkit-full-screen {
    /* your custom css */
}

/* dropped in all browsers except Mozilla Firefox */
:-moz-full-screen {
    /* your custom css */
}

/* dropped in all browsers except Internet Explorer 11 */
:-ms-fullscreen {
    /* your custom css */
}

However having a rule for each thing can make the code much more difficult to maintain, so you can use the selector:

.full-screen-helper {
    /* your custom css */
}

CSS box-sizing

The script has not been tested on older browsers such as IE7, but is likely to work depending on ActiveX support, however box-sizing may not work or you may be using a modern browser and you have changed the control of box-sizing to something like:

.my-element {
    box-sizing: content-box !important;
    padding: 10px !important;
    border: 1px #ccc solid !important;
}

In both cases you can suffer side effects maybe use padding or border.