{"id":20513697,"url":"https://github.com/webreflection/attachshadow","last_synced_at":"2025-06-23T16:03:00.657Z","repository":{"id":57186470,"uuid":"118950107","full_name":"WebReflection/attachshadow","owner":"WebReflection","description":"An iframe based Shadow DOM poorlyfill","archived":false,"fork":false,"pushed_at":"2020-02-25T18:15:58.000Z","size":21,"stargazers_count":58,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-21T09:04:27.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/WebReflection.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":"2018-01-25T18:17:15.000Z","updated_at":"2024-09-02T13:15:10.000Z","dependencies_parsed_at":"2022-09-14T14:21:29.452Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/attachshadow","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/WebReflection/attachshadow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fattachshadow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fattachshadow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fattachshadow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fattachshadow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/attachshadow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fattachshadow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261509337,"owners_count":23169666,"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-11-15T21:12:42.529Z","updated_at":"2025-06-23T16:03:00.073Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","readme":"# attachshadow\n\n[![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026style=flat)](https://github.com/WebReflection/donate)\n[![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC)\n\nAn iframe based Shadow DOM poorlyfill\n\n\n### Features\n\n  * compatible down to **IE9** with a size of about 1.3K\n  * provides an `element.attachShadow(mode)` method out of the box\n  * both mode `open` and `closed` are available. `open` is set to the `shadowRoot` property as expected\n  * events are synthetically re-targeted to the owner, hence propagated to the parent document\n  * encapsulation is preserved, including `:host` CSS declarations\n  * each _iframe_ transparently resizes accordingly to its content\n\n### Missing\n\n  * the `\u003cslot\u003e` element \u003csmall\u003e(under consideration)\u003c/small\u003e\n  * if you `shadowRoot.innerHTML = \"\u003cp onclick='console.log(0)'\u003e\u003c/p\u003e\"` DOM Level 0 events won't ever propagate (inconsistent with real Shadow DOM, just don't do that or simply use [hyperHTML](https://github.com/WebReflection/hyperHTML) instead that will use `addEventListener`)\n\n```js\nhyperHTML(el.shadowRoot)\n  `\u003cp onclick=${() =\u003e console.log('🎉')}\u003e\u003c/p\u003e`;\n```\n\n### What this is not\n\n  * this is not a Custom Elements or an HTMLTemplateElement polyfill. This is only the `attachShadow` method.\n  * this is not, and never could be, a 100% fully standard Shadow DOM polyfill, for the simple reason that Shadow DOM cannot be polyfilled (this is _a poorlyfill_ indeed, with its caveats and compromises)\n  * not yet a battle tested solution. If you have any experience with _iframe_ shenanigans please help making this poorlyfill less poor, thank you!\n\n### CDN\n\nYou can use `https://unpkg.com/attachshadow` as CDN for this library.\n\n### Test\n\nPlease visit the [test page](https://webreflection.github.io/attachshadow/test/) and click on the button to see in console the propagated event in IE9 or any other browser.\n\nYou can also test more modern browsers in this [good old CSS Tricks demo](https://codepen.io/WebReflection/pen/goNNwZ?editors=0010).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fattachshadow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fattachshadow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fattachshadow/lists"}