{"id":17399033,"url":"https://github.com/cdata/focus-observer","last_synced_at":"2025-03-27T22:17:24.058Z","repository":{"id":30210777,"uuid":"33761749","full_name":"cdata/focus-observer","owner":"cdata","description":"Observe focus changes throughout the document, with support for ShadowDOM","archived":false,"fork":false,"pushed_at":"2015-04-13T18:22:07.000Z","size":104,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T00:32:00.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/cdata.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":"2015-04-11T03:55:37.000Z","updated_at":"2020-05-08T00:44:10.000Z","dependencies_parsed_at":"2022-09-05T01:51:41.339Z","dependency_job_id":null,"html_url":"https://github.com/cdata/focus-observer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdata%2Ffocus-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdata%2Ffocus-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdata%2Ffocus-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdata%2Ffocus-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdata","download_url":"https://codeload.github.com/cdata/focus-observer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245931897,"owners_count":20695964,"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-10-16T15:04:03.734Z","updated_at":"2025-03-27T22:17:23.981Z","avatar_url":"https://github.com/cdata.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## FocusObserver\n\nWith the introduction of ShadowDOM, tracking active focus elements on the page\nfor the purposes of accessibility features has been complicated. `FocusObserver`\nis intended to simplify observation of focus changes that span the full depth of\nthe accessibility tree, including parts of the tree within shadow roots.\n\n### Usage\n\n`FocusObserver` has an interface that is modeled after `MutationObserver`.\n\n```javascript\nvar focusObserver = new FocusObserver(function onFocus(event) {\n  console.log('The current active element is', event.activeElement);\n  console.log('The active element\\'s root is', event.activeRoot);\n  console.log('The active element\\'s host is', event.activeHost):\n});\n\n// Connect the focus observer..\nfocusObserver.observe();\n\n// Disconnect the focus observer..\nfocusObserver.disconnect();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdata%2Ffocus-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdata%2Ffocus-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdata%2Ffocus-observer/lists"}