{"id":20318142,"url":"https://github.com/deadcoder0904/generate-hash-inline-script","last_synced_at":"2025-12-03T02:04:03.522Z","repository":{"id":106062004,"uuid":"152948664","full_name":"deadcoder0904/generate-hash-inline-script","owner":"deadcoder0904","description":"Generate Hash for Inline Script when using Chrome Extensions due to Content Security Policy (CSP) error","archived":false,"fork":false,"pushed_at":"2018-10-15T15:05:26.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T13:18:11.117Z","etag":null,"topics":["chrome-extension","chrome-extensions","content-security-policy","csp","hash","inline","inline-script"],"latest_commit_sha":null,"homepage":null,"language":null,"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/deadcoder0904.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T07:10:35.000Z","updated_at":"2018-10-15T15:05:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"94ad8006-cce2-46bc-b7f1-ddfd1da7b140","html_url":"https://github.com/deadcoder0904/generate-hash-inline-script","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/deadcoder0904%2Fgenerate-hash-inline-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadcoder0904%2Fgenerate-hash-inline-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadcoder0904%2Fgenerate-hash-inline-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadcoder0904%2Fgenerate-hash-inline-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadcoder0904","download_url":"https://codeload.github.com/deadcoder0904/generate-hash-inline-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241818899,"owners_count":20025212,"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":["chrome-extension","chrome-extensions","content-security-policy","csp","hash","inline","inline-script"],"created_at":"2024-11-14T18:38:14.004Z","updated_at":"2025-12-03T02:03:58.492Z","avatar_url":"https://github.com/deadcoder0904.png","language":null,"readme":"# generate-hash-inline-script\n\n\u003e Generate Hash for Inline Script while using Chrome Extensions due to Content Security Policy (CSP) errpr ❌\n\n## But, why?\n\nBecause I faced this problem while making [Meta Preview](https://twitter.com/deadcoder0904/status/1048129409885122560)\n\n## Usage\n\nJust replace the `script` variable in `index.js` with the contents of your inline script \u0026 run `index.js`\n\n## Example\n\nIf your inline script is like -\n\n```js\n\u003cscript\u003ealert('Yo Yo Yo!')\u003c/script\u003e\n```\n\nthen replace `script` variable in `index.js` like -\n\n```js\nconst script = `alert('Yo Yo Yo!')`;\n```\n\n\u0026 type in terminal\n\n```bash\nnode index.js\n```\n\nVoila, it will copy the hash to the clipboard.\n\n## Credits\n\nAll the credits go to https://stackoverflow.com/a/38554505/6141587\n\nI just tweaked a little to copy it to clipboard :)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadcoder0904%2Fgenerate-hash-inline-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadcoder0904%2Fgenerate-hash-inline-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadcoder0904%2Fgenerate-hash-inline-script/lists"}