{"id":15979176,"url":"https://github.com/perry-mitchell/shake-n-bake","last_synced_at":"2025-10-08T12:26:43.451Z","repository":{"id":74696442,"uuid":"49553614","full_name":"perry-mitchell/shake-n-bake","owner":"perry-mitchell","description":"Execute script elements that are injected through HTML","archived":false,"fork":false,"pushed_at":"2016-01-13T14:48:43.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T13:23:46.997Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perry-mitchell.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":"2016-01-13T06:13:22.000Z","updated_at":"2016-01-13T13:16:08.000Z","dependencies_parsed_at":"2023-02-25T09:00:24.905Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/shake-n-bake","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/perry-mitchell%2Fshake-n-bake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fshake-n-bake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fshake-n-bake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fshake-n-bake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/shake-n-bake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240215702,"owners_count":19766456,"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-07T23:41:29.203Z","updated_at":"2025-10-08T12:26:43.352Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shake-N-Bake\nExecute script elements that are injected through HTML.\n\n[![Build Status](https://travis-ci.org/perry-mitchell/shake-n-bake.svg?branch=master)](https://travis-ci.org/perry-mitchell/shake-n-bake)\n\n## Why\nWhen injecting HTML into an element using `element.innerHTML = \"...\"`, scripts contained within are not executed. For example, the following JavaScript within the quoted HTML will not execute:\n\n```\nvar container = document.getElementById(\"container\");\ncontainer.innerHTML = '\u003cdiv\u003e\u003cscript type=\"text/javascript\"\u003ealert(\"This won't appear\");\u003c/script\u003e\u003c/div\u003e';\n```\n\n## How it works\nSnB simply takes the content of the script out of the element, and creates a new script element with the contents. It inserts it back into the DOM as an element instance (not a string) and the browser executes the contents.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fshake-n-bake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Fshake-n-bake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fshake-n-bake/lists"}