{"id":22305711,"url":"https://github.com/muratgozel/visibility-state-listener","last_synced_at":"2026-02-28T18:02:46.238Z","repository":{"id":42933937,"uuid":"237757634","full_name":"muratgozel/visibility-state-listener","owner":"muratgozel","description":"Cross-browser document visibility state detection library. Detects if user has switched to another window/tab or not.","archived":false,"fork":false,"pushed_at":"2023-01-07T04:31:08.000Z","size":360,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T07:56:50.802Z","etag":null,"topics":["cross-browser","visibility-event","visibility-state"],"latest_commit_sha":null,"homepage":null,"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/muratgozel.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":"2020-02-02T11:01:28.000Z","updated_at":"2022-10-24T20:27:43.000Z","dependencies_parsed_at":"2023-02-06T11:46:46.492Z","dependency_job_id":null,"html_url":"https://github.com/muratgozel/visibility-state-listener","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/muratgozel/visibility-state-listener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fvisibility-state-listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fvisibility-state-listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fvisibility-state-listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fvisibility-state-listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratgozel","download_url":"https://codeload.github.com/muratgozel/visibility-state-listener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fvisibility-state-listener/sbom","scorecard":{"id":668285,"data":{"date":"2025-08-11","repo":{"name":"github.com/muratgozel/visibility-state-listener","commit":"834e9d392e3fa57890f14ba61c16069276523405"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:57:46.399Z","repository_id":42933937,"created_at":"2025-08-21T18:57:46.399Z","updated_at":"2025-08-21T18:57:46.399Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29946463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T17:57:52.716Z","status":"ssl_error","status_checked_at":"2026-02-28T17:57:31.974Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cross-browser","visibility-event","visibility-state"],"created_at":"2024-12-03T19:12:51.887Z","updated_at":"2026-02-28T18:02:46.218Z","avatar_url":"https://github.com/muratgozel.png","language":"JavaScript","funding_links":["https://ko-fi.com/F1F1RFO7"],"categories":[],"sub_categories":[],"readme":"# visibility-state-listener\nCross-browser **document visibility state** detection library. Detects if user has switched to another window/tab or not.\n\n![NPM](https://img.shields.io/npm/l/visibility-state-listener)\n[![npm version](https://badge.fury.io/js/visibility-state-listener.svg)](https://badge.fury.io/js/visibility-state-listener)\n![npm bundle size](https://img.shields.io/bundlephobia/min/visibility-state-listener)\n![npm](https://img.shields.io/npm/dy/visibility-state-listener)\n\n## Install\n```sh\nnpm i visibility-state-listener\n```\n\n## Import\nThere are different types of distributions depending on your use case. Essentially, the package can be imported via require:\n\n```js\nconst kit = require('visibility-state-listener')\n```\n\nor via script tag:\n\n```html\n\u003cscript src=\"https://unpkg.com/visibility-state-listener@2/dist/visibility-state-listener.iife.js\" crossorigin type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nbut there are lots of other options. See distribution report below.\n\n## Use\n```js\nconst listener = require('./createVisibilityStateListener')\n// if you injected the library with script tag use: window.VisibilityStateListener global\n\n// register listener function\nlistener.on('update', function(newState) {\n  const isWindowVisible = newState == 'visible'\n})\n\n// start to listen for visibility changes\nlistener.start()\n```\n\nIt registers appropriate listener functions according to the browser. If you want to remove them call `.pause()`:\n```js\n// no event will be emitted after calling pause\nlistener.pause()\n```\n\n---\n\n## Distributions Report\nThis is an auto-generated report that shows the type, name and size of the bundles available to use individually.\n\n[comment]: # (DISTRIBUTIONS_REPORT_START)\n```js\n[\n  \"visibility-state-listener.amd.js (1.88 KB)\",\n  \"visibility-state-listener.amd.polyfilled.js (10.25 KB)\",\n  \"visibility-state-listener.cjs.js (1.87 KB)\",\n  \"visibility-state-listener.cjs.polyfilled.js (10.27 KB)\",\n  \"visibility-state-listener.es.js (1.78 KB)\",\n  \"visibility-state-listener.es.polyfilled.js (10.18 KB)\",\n  \"visibility-state-listener.iife.js (1.89 KB)\",\n  \"visibility-state-listener.iife.polyfilled.js (10.26 KB)\",\n  \"visibility-state-listener.umd.js (2.14 KB)\",\n  \"visibility-state-listener.umd.polyfilled.js (10.51 KB)\"\n]\n```\n[comment]: # (DISTRIBUTIONS_REPORT_END)\n\n## Babel Polyfills Report\nThis is an auto-generated report that shows the pollyfils added by core-js to the **pollyfilled** distributions based on the targets configuration described below.\n\n[comment]: # (BABEL_POLYFILLS_REPORT_START)\n```js\n// polyfills:\n[]\n// based on the targets:\n{\n  \"android\": \"4.4.3\",\n  \"chrome\": \"49\",\n  \"edge\": \"18\",\n  \"firefox\": \"78\",\n  \"ie\": \"9\",\n  \"ios\": \"6\",\n  \"opera\": \"73\",\n  \"safari\": \"5.1\",\n  \"samsung\": \"4\"\n}\n```\n[comment]: # (BABEL_POLYFILLS_REPORT_END)\n\nThanks for watching 🐬\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/F1F1RFO7)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fvisibility-state-listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratgozel%2Fvisibility-state-listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fvisibility-state-listener/lists"}