{"id":24401720,"url":"https://github.com/thomasdev-de/iframeresizer","last_synced_at":"2026-03-05T19:02:49.527Z","repository":{"id":272721951,"uuid":"917348371","full_name":"ThomasDev-de/iFrameResizer","owner":"ThomasDev-de","description":"A simple JavaScript library for resizing iframes and communicating scroll events to the parent window.","archived":false,"fork":false,"pushed_at":"2025-04-30T06:13:04.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T00:51:55.198Z","etag":null,"topics":["iframe-resizer","javascript"],"latest_commit_sha":null,"homepage":"","language":null,"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/ThomasDev-de.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-15T20:14:01.000Z","updated_at":"2025-08-04T20:50:21.000Z","dependencies_parsed_at":"2025-01-16T08:51:31.510Z","dependency_job_id":"3e788ce6-e419-4ae0-a107-7abbd078077f","html_url":"https://github.com/ThomasDev-de/iFrameResizer","commit_stats":null,"previous_names":["thomasdev-de/iframeresizer"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ThomasDev-de/iFrameResizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasDev-de%2FiFrameResizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasDev-de%2FiFrameResizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasDev-de%2FiFrameResizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasDev-de%2FiFrameResizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasDev-de","download_url":"https://codeload.github.com/ThomasDev-de/iFrameResizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasDev-de%2FiFrameResizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: 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":["iframe-resizer","javascript"],"created_at":"2025-01-20T00:46:14.685Z","updated_at":"2026-03-05T19:02:49.519Z","avatar_url":"https://github.com/ThomasDev-de.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# IFrameResizer\n\nA lightweight JavaScript library for seamless iframe communication and automatic resizing.\n\n## Features\n\n- Automatic iframe height and width adjustment\n- Two-way communication between parent and child frames\n- Scroll position synchronization\n- Custom event handling\n- Ready-state detection\n- Configurable logging\n- Singleton pattern in a child frame\n\n## Installation\n\nAdd both scripts to your project:\n\n```html\n\u003c!-- In parent page --\u003e\n\u003cscript src=\"/dist/iframe-resizer-parent.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- In child page --\u003e\n\u003cscript src=\"/dist/iframe-resizer-child.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Parent Page\n\nBasic setup:\n\n```javascript\nconst resizer = new IFrameResizer('#myIframe', {\n    log: true,\n    onResize: (width, height) =\u003e {\n        console.log(`Iframe resized to ${width}x${height}`);\n    }\n}).onReady(() =\u003e {\n    console.log('Iframe is ready!');\n});\n```\n\nAdvanced usage with custom messages:\n\n```javascript\nconst resizer = new IFrameResizer('#myIframe', {\n    targetOrigin: 'https://child-domain.com',\n    log: true\n});\n\n// Handle custom messages\nresizer.onMessage('customEvent', (payload) =\u003e {\n    console.log('Custom event received:', payload);\n});\n\n// Send message to child\nresizer.sendMessage('updateContent', {data: 'Hello Child!'});\n```\n\n### Child Page\n\nBasic setup:\n\n```javascript\nwindow.IFrameResizer.create({\n    log: true\n});\n```\n\nAdvanced usage with custom messages:\n\n```javascript\nconst resizer = window.IFrameResizer.create({\n    targetOrigin: 'https://parent-domain.com',\n    log: true\n});\n\n// Handle custom messages\nresizer.onMessage('updateContent', (payload) =\u003e {\n    console.log('Update received:', payload);\n});\n\n// Send message to parent\nresizer.sendMessage('customEvent', {data: 'Hello Parent!'});\n```\n\n## Configuration Options\n\n### Parent Options\n\n| Option       | Type     | Default | Description                    |\n|--------------|----------|---------|--------------------------------|\n| targetOrigin | string   | '*'     | Allowed origin for postMessage |\n| log          | boolean  | false   | Enable console logging         |\n| onResize     | function | null    | Callback for resize events     |\n| onScroll     | function | null    | Callback for scroll events     |\n\n### Child Options\n\n| Option       | Type    | Default | Description                    |\n|--------------|---------|---------|--------------------------------|\n| targetOrigin | string  | '*'     | Allowed origin for postMessage |\n| log          | boolean | false   | Enable console logging         |\n| resize       | boolean | true    | Enable auto-resizing           |\n| scroll       | boolean | true    | Enable scroll tracking         |\n\n## API Reference\n\n### Parent Methods\n\n- `onReady(callback)`: Register callback for iframe ready state\n- `onMessage(type, callback)`: Register custom message handler\n- `sendMessage(type, data)`: Send a message to child iframe\n- `destroy()`: Clean up event listeners\n\n### Child Methods\n\n- `onMessage(type, callback)`: Register custom message handler\n- `sendMessage(type, data)`: Send a message to parent\n- `destroy()`: Clean up instance and listeners\n\n## Events\n\n### Built-in Events\n\n- `ready`: Sent when child iframe is initialized\n- `resize`: Triggered on size changes\n- `scroll`: Triggered on scroll position changes\n\n### Custom Events\n\nYou can define and handle custom events using `onMessage()` and `sendMessage()`.\n\n## Browser Support\n\n- All modern browsers (Chrome, Firefox, Safari, Edge)\n- Requires `ResizeObserver` support (or polyfill)\n- Requires `postMessage` support\n\n## License\n\nMIT License\n\n## Contributing\n\nFeel free to submit issues and pull requests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasdev-de%2Fiframeresizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasdev-de%2Fiframeresizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasdev-de%2Fiframeresizer/lists"}