{"id":18389562,"url":"https://github.com/anseki/polyfill-svg-uri","last_synced_at":"2026-03-11T03:32:33.794Z","repository":{"id":57327032,"uuid":"44257570","full_name":"anseki/polyfill-svg-uri","owner":"anseki","description":"Polyfill for plain SVG as Data URI scheme.","archived":false,"fork":false,"pushed_at":"2022-08-19T03:37:20.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-01T05:08:12.020Z","etag":null,"topics":["background","css","css-properties","css-rules","css-styles","data-uri-scheme","firefox","ie","iframe","img","polyfill","src","style","svg"],"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/anseki.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":"2015-10-14T15:34:27.000Z","updated_at":"2025-10-04T13:57:29.000Z","dependencies_parsed_at":"2022-08-31T04:21:54.964Z","dependency_job_id":null,"html_url":"https://github.com/anseki/polyfill-svg-uri","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/anseki/polyfill-svg-uri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpolyfill-svg-uri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpolyfill-svg-uri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpolyfill-svg-uri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpolyfill-svg-uri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anseki","download_url":"https://codeload.github.com/anseki/polyfill-svg-uri/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpolyfill-svg-uri/sbom","scorecard":{"id":198021,"data":{"date":"2025-08-11","repo":{"name":"github.com/anseki/polyfill-svg-uri","commit":"1b5e8340dafca1a4244def1db3bff8abdf4f816f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T22:11:40.661Z","repository_id":57327032,"created_at":"2025-08-16T22:11:40.662Z","updated_at":"2025-08-16T22:11:40.662Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30369379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["background","css","css-properties","css-rules","css-styles","data-uri-scheme","firefox","ie","iframe","img","polyfill","src","style","svg"],"created_at":"2024-11-06T01:43:44.488Z","updated_at":"2026-03-11T03:32:33.765Z","avatar_url":"https://github.com/anseki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# polyfillSvgUri\n\n[![npm](https://img.shields.io/npm/v/polyfill-svg-uri.svg)](https://www.npmjs.com/package/polyfill-svg-uri) [![GitHub issues](https://img.shields.io/github/issues/anseki/polyfill-svg-uri.svg)](https://github.com/anseki/polyfill-svg-uri/issues) [![dependencies](https://img.shields.io/badge/dependencies-No%20dependency-brightgreen.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nPolyfill for plain SVG as Data URI scheme.\n\nThe plain SVG without encoding (e.g. Base64, URL encoding, etc.) that is written in the [Data URI scheme](http://tools.ietf.org/html/rfc2397) is easy to read, easy to edit and small size.  \nThat Data URI scheme is written in for example, `background-image`, `list-style-image`, `cursor` CSS properties, `src`, `data` attributes of `\u003cimg\u003e`, `\u003cinput\u003e`, `\u003ciframe\u003e`, `\u003cobject\u003e` elements, etc..\n\n```css\ndiv {\n  background: url('data:image/svg+xml;utf8,\u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"96\" height=\"96\"\u003e\u003cpath d=\"M10,10L32,90L90,32z\" fill=\"lightgreen\"/\u003e\u003c/svg\u003e') center no-repeat;\n}\n```\n\nBut IE ignores it, and some browsers consider `#` as the hash.  \nThis polyfill solves those problems. It passes encoded SVG to IE, and it escapes `#`.\n\n## Usage\n\n```html\n\u003cscript src=\"polyfill-svg-uri.min.js\"\u003e\u003c/script\u003e\n```\n\n### Supported Places\n\nThe plain SVGs as Data URI scheme are enabled in:\n\n#### CSS styles in stylesheets\n\nFor example: `\u003clink\u003e` and `\u003cstyle\u003e` tags\n\n#### CSS styles in inline-style\n\nFor example:\n\n```html\n\u003cdiv style=\"background-image: url('data:image/svg+xml;utf8,\u003csvg\u003e...')\"\u003e\n```\n\n#### `src` and `data` attributes of `\u003cimg\u003e`, `\u003cinput\u003e`, `\u003ciframe\u003e`, `\u003cobject\u003e` tags, etc.\n\nFor example:\n\n```html\n\u003cimg src=\"data:image/svg+xml;utf8,\u003csvg\u003e...\"\u003e\n```\n\n#### CSS properties of `elment.style`\n\nFor example:\n\n```js\ndocument.getElementById('media-1').style.backgroundImage =\n  'url(\\'data:image/svg+xml;utf8,\u003csvg\u003e...\\')';\n```\n\n#### `elment.style.cssText` property\n\nFor example:\n\n```js\ndocument.getElementById('media-1').style.cssText =\n  'background-image: url(\\'data:image/svg+xml;utf8,\u003csvg\u003e...\\');';\n```\n\n#### `elment.style.setProperty` method\n\nFor example:\n\n```js\ndocument.getElementById('media-1').style.setProperty(\n  'background-image', 'url(\\'data:image/svg+xml;utf8,\u003csvg\u003e...\\')');\n```\n\n#### New CSS rules\n\nFor example:\n\n```js\nvar styleSheet = document.styleSheets[0],\n  selector = '#media-1',\n  cssText = 'background-image: url(\\'data:image/svg+xml;utf8,\u003csvg\u003e...\\');';\nif (styleSheet.insertRule) {\n  styleSheet.insertRule(selector + '{' + cssText + '}', 0);\n} else if (styleSheet.addRule) {\n  styleSheet.addRule(selector, cssText);\n}\n```\n\n#### Existing CSS rules\n\nFor example:\n\n```js\ndocument.styleSheets[0].cssRules[0].style.backgroundImage =\n  'url(\\'data:image/svg+xml;utf8,\u003csvg\u003e...\\')';\n```\n\n#### `elment.src` and `elment.data` properties\n\nFor example:\n\n```js\ndocument.getElementById('media-1').src =\n  'data:image/svg+xml;utf8,\u003csvg\u003e...';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fpolyfill-svg-uri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanseki%2Fpolyfill-svg-uri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fpolyfill-svg-uri/lists"}