# fullscreen

> fullscreen polyfill api that presents an event emitter

Latest version **1.1.1** (published 2017-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install fullscreen
pnpm add fullscreen
yarn add fullscreen
bun add fullscreen
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-09-02 |
| First published | 2013-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Chris Dickinson |
| Maintainers | ggingell, chrisdickinson |
| Keywords | fullscreen, html5, canvas, browserify |

## Links

- npm: https://www.npmjs.com/package/fullscreen
- Repository: https://github.com/chrisdickinson/fullscreen
- Homepage: https://github.com/chrisdickinson/fullscreen#readme
- Issues: https://github.com/chrisdickinson/fullscreen/issues
- npm.io page: https://npm.io/package/fullscreen

## Dependencies (1)

- [add-event-listener](https://npm.io/package/add-event-listener.md) 0.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2017-09-02
- 1.1.0 — 2016-06-18
- 1.0.2 — 2015-11-27
- 1.0.1 — 2015-10-02
- 1.0.0 — 2015-04-20
- 0.1.0 — 2014-06-20
- 0.0.1 — 2013-01-05

## README

# fullscreen

polyfill for requestFullscreen

```javascript

var fullscreen = require('fullscreen')
  , el = document.getElementById('element')
  , fs

fs = fullscreen(el)

el.addEventListener('click', function() {
  fs.request()
})

document.body.onkeydown = function() {
  fs.release()
}

fs.on('attain', function() {
  // attained fullscreen
})

fs.on('release', function() {
  // released fullscreen
})

fs.on('error', function() {
  // fullscreen request failed, or
  // fullscreen isn't supported
})

```

# API

## require('fullscreen').available() -> bool

return a boolean yes/no for whether fullscreen api is supported.

## require('fullscreen').enabled() -> bool

return a boolean yes/no for whether fullscreen is enabled for the document.

## fullscreen(element) -> fs event emitter

return a fullscreen event emitter object. if fullscreen is not
available, on the next turn of the event loop it'll emit `'error'`.

## fs.request() -> undefined

issue a request for fullscreen. if it's accepted, it emits `'attain'`, otherwise `'error'` for denial.

## fs.release() -> undefined

release the current fullscreen element. if the fullscreen is released, it emits `'release'`.

## fs.dispose() -> undefined

removes any event listeners created by the `fs` instance once you're done with it.

## fs.target() -> HTMLElement?

returns the current fullscreen target, if any.

# License

MIT

---
_Source: https://npm.io/package/fullscreen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
