{"id":25404959,"url":"https://github.com/grtjn/view-binary-element","last_synced_at":"2026-05-16T08:03:35.220Z","repository":{"id":58229841,"uuid":"126385703","full_name":"grtjn/view-binary-element","owner":"grtjn","description":"Native Web Component for previewing a few common types of binary files","archived":false,"fork":false,"pushed_at":"2020-11-18T08:19:42.000Z","size":2905,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-30T23:11:24.106Z","etag":null,"topics":["html5","javascript","web-components"],"latest_commit_sha":null,"homepage":"http://grtjn.github.io/view-binary-element/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grtjn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-22T19:32:07.000Z","updated_at":"2020-11-18T08:18:21.000Z","dependencies_parsed_at":"2022-08-31T09:21:36.296Z","dependency_job_id":null,"html_url":"https://github.com/grtjn/view-binary-element","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/grtjn/view-binary-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grtjn%2Fview-binary-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grtjn%2Fview-binary-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grtjn%2Fview-binary-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grtjn%2Fview-binary-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grtjn","download_url":"https://codeload.github.com/grtjn/view-binary-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grtjn%2Fview-binary-element/sbom","scorecard":{"id":446728,"data":{"date":"2025-08-11","repo":{"name":"github.com/grtjn/view-binary-element","commit":"29fe676023f43cd6b89680bf915e79e53ab785a9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"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":"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: Apache License 2.0: 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-19T06:55:17.324Z","repository_id":58229841,"created_at":"2025-08-19T06:55:17.324Z","updated_at":"2025-08-19T06:55:17.324Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278289498,"owners_count":25962356,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":["html5","javascript","web-components"],"created_at":"2025-02-16T04:29:43.053Z","updated_at":"2025-10-04T08:56:44.264Z","avatar_url":"https://github.com/grtjn.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# view-binary-element\nNative Web Component for previewing a few common types of binary files\n\nThis is essentially a refactored version of https://github.com/grtjn/view-file-ng to eliminate AngularJS. Not yet as feature rich though.\n\nDisclaimer: Work in Progress, and not tested in production. Feedback welcome though.\n\nCheck https://caniuse.com/ to verify how well Web Components is covered by current browsers. This component uses Custom Elements v1, (optionally) HTML Imports, HTML Templates, Shadow DOM v1 (gracefull decay would be possible).\n\n## Installation\n\n### CDN and polyfill\n\nSimplest way:\n\n    \u003clink rel=\"import\" href=\"https://cdn.rawgit.com/grtjn/view-binary-element/master/view-binary.html\"\u003e\n\nLikely together with this polyfill:\n\n    \u003cscript src=\"https://cdn.rawgit.com/webcomponents/webcomponentsjs/v1.2.0/webcomponents-hi.js\" type=\"text/javascript\" defer\u003e\u003c/script\u003e\n\n\n### NPM and html-loader\n\nThis component is also published on npm:\n\n    npm install --save view-binary-element\n\nPotentially combined with something like:\n\n    \u003c%= require('html-loader!../node_modules/view-binary-element/view-binary.html') %\u003e\n\n### Bower, wiredep, and gulp\n\nThis component is also published on bower:\n\n    bower install --save view-binary-element\n\nYou can combine that with gulp and wiredep with something like:\n\n    .pipe(gulpWiredep({\n      fileTypes: {\n        html: {\n          block: /(([ \\t]*)\u003c!--\\s*bower:*(\\S*)\\s*--\u003e)(\\n|\\r|.)*?(\u003c!--\\s*endbower\\s*--\u003e)/gi,\n          detect: {\n            js: /\u003cscript.*src=['\"]([^'\"]+)/gi,\n            css: /\u003clink.*href=['\"]([^'\"]+)/gi,\n            html: /\u003clink.*href=['\"]([^'\"]+)/gi\n          },\n          replace: {\n            js: '\u003cscript src=\"{{filePath}}\"\u003e\u003c/script\u003e',\n            css: '\u003clink rel=\"stylesheet\" href=\"{{filePath}}\"\u003e',\n            html: '\u003clink rel=\"import\" href=\"{{filePath}}\"\u003e'\n          }\n        }\n      }\n    }))\n\nAdd this to your index.html:\n\n    \u003c!-- bower:html --\u003e\n    \u003clink rel=\"import\" href=\"/bower_components/view-binary-element/view-binary.html\"\u003e\n    \u003c!-- endbower --\u003e\n\n    \u003c!-- @exclude --\u003e\n    \u003cscript src=\"https://cdn.rawgit.com/webcomponents/webcomponentsjs/v1.2.0/webcomponents-hi.js\" type=\"text/javascript\" defer\u003e\u003c/script\u003e\n    \u003c!-- @endexclude --\u003e\n\nThis relies on the html-import polyfill loaded from CDN. If you prefer not to rely on that, or if your tooling builds minified versions of everything, you can include the html similarly to html-loader mentioned above in NPM, and strip off the polyfill using gulp-preprocessor roughly like this:\n\n    .pipe(gulpReplace(/\u003clink rel=\"import\" href=\"([^\"]+)\"\u003e/g, '\u003c!-- @include ../$1 --\u003e'))\n    .pipe(gulpPreprocess())\n\n## Usage\n\nExample:\n\n    \u003cview-binary class=\"audio\" src=\"data/sample-music.mp3\" type=\"audio/mpeg\" title=\"sample-music.mp3\"\u003e\n      \u003ca slot=\"fallback\" href=\"data/sample-music.mp3\" target=\"_blank\" download\u003eDownload sample-music.mp3\u003c/a\u003e\n    \u003c/view-binary\u003e\n\nDoes not emit events.\n\n### Plaing HTML and JavaScript\n\n- Assumes CDN and polyfill installation\n- In your html:\n\n        \u003cstyle\u003e\n        view-binary {\n          display: block;\n          height: 300px;\n        }\n        view-binary.audio {\n          height: 32px;\n        }\n        \u003c/style\u003e\n    \n        \u003cview-binary class=\"audio\" src=\"data/sample-music.mp3\" type=\"audio/mpeg\" title=\"sample-music.mp3\"\u003e\n          \u003ca slot=\"fallback\" href=\"data/sample-music.mp3\" target=\"_blank\" download\u003eDownload sample-music.mp3\u003c/a\u003e\n        \u003c/view-binary\u003e\n\n### Vue.js\n\n- Import or include the web component in your index.html (see for instance NPM and html-loader installation)\n- Add `view-binary` to ignoreElements to stop it from squeaking:\n\n        Vue.config.ignoredElements = [\"view-binary\"];\n\n- Use it in any component:\n\n        \u003cview-binary :src=\"viewUri\" :type=\"contentType\" :title=\"fileName\"\u003e\n          \u003ca slot=\"fallback\" class=\"btn btn-default\" :href=\"downloadUri\" target=\"_blank\" download\u003eDownload {{ fileName }}\u003c/a\u003e\n        \u003c/view-binary\u003e\n\n### AngularJS\n\n- Assumes Bower, wiredep, and gulp installation\n- In your html template:\n\n        \u003cview-binary src=\"{{viewUri}}\" type=\"{{contentType}}\" title=\"{{fileName}}\"\u003e\n          \u003ca slot=\"fallback\" class=\"btn btn-default\" href=\"{{downloadUri}}\" target=\"_blank\" download\u003eDownload {{ fileName }}\u003c/a\u003e\n        \u003c/view-binary\u003e\n\n## Test locally\n\n- Uncomment the local import line in docs/index.html\n- Run something like `python -m SimpleHTTPServer 8888` from project root\n- Open http://localhost:8888/docs/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrtjn%2Fview-binary-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrtjn%2Fview-binary-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrtjn%2Fview-binary-element/lists"}