{"id":13561505,"url":"https://github.com/rafgraph/fscreen","last_synced_at":"2025-04-08T12:06:45.140Z","repository":{"id":37725023,"uuid":"89558087","full_name":"rafgraph/fscreen","owner":"rafgraph","description":"Vendor agnostic access to the Fullscreen API","archived":false,"fork":false,"pushed_at":"2021-05-04T01:48:09.000Z","size":1382,"stargazers_count":440,"open_issues_count":6,"forks_count":45,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-01T10:17:23.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fscreen.rafgraph.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafgraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-27T05:11:32.000Z","updated_at":"2025-03-22T10:46:06.000Z","dependencies_parsed_at":"2022-07-14T00:50:40.123Z","dependency_job_id":null,"html_url":"https://github.com/rafgraph/fscreen","commit_stats":null,"previous_names":["rafrex/fscreen"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Ffscreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Ffscreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Ffscreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Ffscreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafgraph","download_url":"https://codeload.github.com/rafgraph/fscreen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318739,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:00:57.668Z","updated_at":"2025-04-08T12:06:45.112Z","avatar_url":"https://github.com/rafgraph.png","language":"JavaScript","readme":"# Fscreen - Fullscreen API\n\n[![npm](https://img.shields.io/npm/dm/fscreen?label=npm)](https://www.npmjs.com/package/fscreen) [![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/fscreen?color=purple)](https://bundlephobia.com/result?p=fscreen)\n\nVendor agnostic access to the [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API). Build with the Fullscreen API as intended without worrying about vendor prefixes.\n\n---\n\n### [Live demo app for Fscreen](https://fscreen.rafgraph.dev)\n\nCode is in the [`/demo`](/demo) folder.\n\n---\n\n```shell\n$ npm install --save fscreen\n```\n\n```javascript\nimport fscreen from 'fscreen';\n\nfscreen.fullscreenEnabled === true / false;\n// boolean to tell if fullscreen mode is supported\n// replacement for: document.fullscreenEnabled\n// mapped to: document.vendorMappedFullscreenEnabled\n\nfscreen.fullscreenElement === null / undefined / DOM Element;\n// null if not in fullscreen mode, or the DOM element that's in fullscreen mode\n// (if fullscreen is not supported by the device it will be undefined)\n// replacement for: document.fullscreenElement\n// mapped to: document.vendorMappedFullsceenElement\n// note that fscreen.fullscreenElement uses a getter to retrieve the element\n// each time the property is accessed.\n\n\nfscreen.requestFullscreen(element);\n// replacement for: element.requestFullscreen()\n// mapped to: element.vendorMappedRequestFullscreen()\n\nfscreen.requestFullscreenFunction(element);\n// replacement for: element.requestFullscreen - without calling the function\n// mapped to: element.vendorMappedRequestFullscreen\n\nfscreen.exitFullscreen();\n// replacement for: document.exitFullscreen()\n// mapped to: document.vendorMappedExitFullscreen()\n// note that fscreen.exitFullscreen is mapped to\n// document.vendorMappedExitFullscreen - without calling the function\n\n\nfscreen.onfullscreenchange = handler;\n// replacement for: document.onfullscreenchange = handler\n// mapped to: document.vendorMappedOnfullscreenchange = handler\n\nfscreen.addEventListener('fullscreenchange', handler, options);\n// replacement for: document.addEventListener('fullscreenchange', handler, options)\n// mapped to: document.addEventListener('vendorMappedFullscreenchange', handler, options)\n\nfscreen.removeEventListener('fullscreenchange', handler, options);\n// replacement for: document.removeEventListener('fullscreenchange', handler, options)\n// mapped to: document.removeEventListener('vendorMappedFullscreenchange', handler, options)\n\n\nfscreen.onfullscreenerror = handler;\n// replacement for: document.onfullscreenerror = handler\n// mapped to: document.vendorMappedOnfullscreenerror = handler\n\nfscreen.addEventListener('fullscreenerror', handler, options);\n// replacement for: document.addEventListener('fullscreenerror', handler, options)\n// mapped to: document.addEventListener('vendorMappedFullscreenerror', handler, options)\n\nfscreen.removeEventListener('fullscreenerror', handler, options);\n// replacement for: document.removeEventListener('fullscreenerror', handler, options)\n// mapped to: document.removeEventListener('vendorMappedFullscreenerror', handler, options)\n\n\nfscreen.fullscreenPseudoClass;\n// returns: the vendorMapped fullscreen Pseudo Class\n// i.e. :fullscreen, :-webkit-full-screen, :-moz-full-screen, :-ms-fullscreen\n// Can be used to find any elements that are fullscreen using the vendorMapped Pseudo Class \n// e.g. document.querySelectorAll(fscreen.fullscreenPseudoClass).forEach(...);\n```\n\n## Usage\n\nUse it just like the spec API.\n\n```javascript\nif (fscreen.fullscreenEnabled) {\n fscreen.addEventListener('fullscreenchange', handler, false);\n fscreen.requestFullscreen(element);\n}\n\nfunction handler() {\n if (fscreen.fullscreenElement !== null) {\n   console.log('Entered fullscreen mode');\n } else {\n   console.log('Exited fullscreen mode');\n }\n}\n```\n","funding_links":[],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafgraph%2Ffscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafgraph%2Ffscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafgraph%2Ffscreen/lists"}