{"id":16133795,"url":"https://github.com/martindzejky/modify-element","last_synced_at":"2026-02-26T11:31:21.675Z","repository":{"id":38427168,"uuid":"173078570","full_name":"martindzejky/modify-element","owner":"martindzejky","description":"Allows you to easily modify elements on websites using MutationObserver.","archived":false,"fork":false,"pushed_at":"2024-10-03T14:28:16.000Z","size":468,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T17:52:54.624Z","etag":null,"topics":["mutation-observer","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martindzejky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-02-28T09:07:11.000Z","updated_at":"2024-10-03T14:28:18.000Z","dependencies_parsed_at":"2023-02-08T09:30:40.681Z","dependency_job_id":"5b8729d9-0334-4164-9cff-65b4de0c13bd","html_url":"https://github.com/martindzejky/modify-element","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/martindzejky/modify-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindzejky%2Fmodify-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindzejky%2Fmodify-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindzejky%2Fmodify-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindzejky%2Fmodify-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martindzejky","download_url":"https://codeload.github.com/martindzejky/modify-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martindzejky%2Fmodify-element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29857473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"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":["mutation-observer","typescript"],"created_at":"2024-10-09T22:45:56.765Z","updated_at":"2026-02-26T11:31:21.636Z","avatar_url":"https://github.com/martindzejky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modify-element\n\n![prettier](https://img.shields.io/badge/format-prettier-blueviolet.svg)\n![version](https://img.shields.io/github/package-json/v/martindzejky/modify-element.svg)\n\nAllows you to easily modify HTML elements on websites.\nA small utility library to simplify working with the `MutationObserver` browser API.\n\n## Usage\n\nYou register a CSS selector and a callback function. When started, the callback function\nwill be called when any element matching the selector appears in the DOM. Suitable for\nstatic websites as well as dynamic web apps.\n\n1. Import or copy-paste the script to your code\n1. Register your selector and callback using `ModifyElement.registerSelector`\n1. Start the observer using `ModifyElement.start`\n\n## API\n\nThe library exports a single global variable called `ModifyElement` which provides the public API.\n\n### `ModifyElement.registerSelector`\n\nRegister a new selector and a callback function. The callback will\nbe called whenever a new element matching the selector appears in the DOM.\n\n- `selector` Selector matching the target element\n- `callback` Callback function to call with the element\n\n### `ModifyElement.unregisterSelector`\n\nRemove the registered callback.\n\n- `selector` Selector assigned with the callback \n- `callback` Callback function to remove\n\n### `ModifyElement.start`\n\nStart observing the root element. This applies all registered\nselectors and starts the MutationObserver.\n\n- `rootElement` Root element to observe, usually this can be `document.documentElement`\n\n### `ModifyElement.stop`\n\nStop observing the root element.\n\n## Development\n\nClone the repository locally first. This project uses `npm` so call `npm install` to install\nthe dependencies. Then there are these important scripts:\n\n- `npm build` - Build a development version\n- `npm build:min` - Build a production version (minified)\n- `npm build:watch` - Watch source files and rebuild\n\n## Tests\n\nSee [#1](https://github.com/martindzejky/modify-element/issues/1).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindzejky%2Fmodify-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartindzejky%2Fmodify-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindzejky%2Fmodify-element/lists"}