{"id":13567770,"url":"https://github.com/springload/react-iframe-click","last_synced_at":"2025-08-08T06:12:17.823Z","repository":{"id":45252938,"uuid":"205970294","full_name":"springload/react-iframe-click","owner":"springload","description":"Detect clicks on iframe (but not within)","archived":false,"fork":false,"pushed_at":"2021-12-27T23:38:49.000Z","size":6,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-12-02T09:41:20.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-iframe-click","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/springload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-03T02:11:04.000Z","updated_at":"2024-06-03T04:00:16.000Z","dependencies_parsed_at":"2022-09-07T13:21:17.007Z","dependency_job_id":null,"html_url":"https://github.com/springload/react-iframe-click","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/springload%2Freact-iframe-click","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-iframe-click/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-iframe-click/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-iframe-click/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/react-iframe-click/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228267808,"owners_count":17893841,"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:02:42.512Z","updated_at":"2024-12-05T09:16:42.382Z","avatar_url":"https://github.com/springload.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# React Iframe click\n\nCross-domain `\u003ciframe\u003e`s don't have click events, but they can be inferred with this library.\n\nJust pass in an `onInferredClick` handler and you'll receive a callback when the iframe is clicked/tapped the first time.\n\n# How?\n\nWe can check for a window blur event, and then see if focus has moved to the iframe from which we infer a click.\n\nBecause it's infering clicks by focus changes if the focus stays within the iframe it will only be able to infer clicks once.\n\nThis library is less than 1kb and has TypeScript bindings.\n\n# Usage\n\n```jsx\nimport Iframe from 'react-iframe-click';\n\n// in a render...\n\n\u003cIframe\n    src=\"https://example.com\"\n    onInferredClick={() =\u003e alert('You clicked')}\n\u003e\u003c/Iframe\u003e;\n```\n\n# Requirements\n\nPeer dependency on React 16.8 or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-iframe-click","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Freact-iframe-click","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-iframe-click/lists"}