{"id":40506197,"url":"https://github.com/tomhodgins/jsincss-protocol-sniffer","last_synced_at":"2026-01-20T19:36:16.610Z","repository":{"id":57284497,"uuid":"119219839","full_name":"tomhodgins/jsincss-protocol-sniffer","owner":"tomhodgins","description":"A protocol sniffer plugin for jsincss","archived":false,"fork":false,"pushed_at":"2018-12-24T20:57:17.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-30T15:41:51.623Z","etag":null,"topics":["at-rules","css","css-selector","js-in-css","jsincss","protocol","selector-resolver"],"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/tomhodgins.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":"2018-01-28T02:09:21.000Z","updated_at":"2018-12-24T20:57:18.000Z","dependencies_parsed_at":"2022-09-16T22:40:47.948Z","dependency_job_id":null,"html_url":"https://github.com/tomhodgins/jsincss-protocol-sniffer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomhodgins/jsincss-protocol-sniffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-protocol-sniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-protocol-sniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-protocol-sniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-protocol-sniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomhodgins","download_url":"https://codeload.github.com/tomhodgins/jsincss-protocol-sniffer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-protocol-sniffer/sbom","scorecard":{"id":892623,"data":{"date":"2025-08-18","repo":{"name":"github.com/tomhodgins/jsincss-protocol-sniffer","commit":"80baa4748b32b94c7c5131ca5cc3294bcbb466e4"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T12:26:44.993Z","repository_id":57284497,"created_at":"2025-08-24T12:26:44.993Z","updated_at":"2025-08-24T12:26:44.993Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28610770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["at-rules","css","css-selector","js-in-css","jsincss","protocol","selector-resolver"],"created_at":"2026-01-20T19:36:15.832Z","updated_at":"2026-01-20T19:36:16.044Z","avatar_url":"https://github.com/tomhodgins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsincss-protocol-sniffer\n\nA protocol sniffer plugin for [jsincss](https://github.com/tomhodgins/jsincss)\n\n## About\n\nThis plugin is a JavaScript module that works with [JS-in-CSS stylesheets](https://responsive.style/theory/what-is-a-jic-stylesheet.html), to apply styles based on the protocol currently in use.\n\n## Downloading\n\nYou can download jsincss-protocol-sniffer and add it to your codebase manually, or download it with npm:\n\n```bash\nnpm install jsincss-protocol-sniffer\n```\n\nAnother option that works for building or testing, that isn't ideal for production use, is linking to the module directly from a CDN like unpkg:\n\n```html\n\u003cscript type=module\u003e\n  import protocol from 'https://unpkg.com/jsincss-protocol-sniffer/index.vanilla.js'\n\u003c/script\u003e\n```\n\n## Importing\n\nThis plugin exists in three different formats:\n\n- CommonJS module: [index.js](index.js)\n- Vanilla JS module: [index.vanilla.js](index.vanilla.js)\n- Browser function: [index.browser.js](index.browser.js)\n\nYou can import this plugin using the native [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) statement in JavaScript. Here you can assign any name you want to the function you are importing, and you only need to provide a path to the plugin's `index.vanilla.js` file:\n\n```js\nimport protocol from './index.vanilla.js'\n```\n\nYou can also use the CommonJS-formatted module located at [index.js](index.js) with `require()` for use with bundlers that don't use vanilla JS modules.\n\nOnce you have imported this plugin into your module, you can use the plugin as `protocol()`\n\n## Using JS-in-CSS Stylesheets\n\nThe main goal of this plugin is to allow CSS authors the ability to target different styles based on the current protocol currently being used to access the web page (`file`, `http`, and `https` are supported).\n\nThe plugin has the following format:\n\n```js\nprotocol(options, stylesheet)\n```\n\n- `options` is an array containing strings of the protocols where you want the styles to apply\n- `stylesheet` is a string or template string containing a CSS stylesheet\n\n## Example\n\nThis example will use the `jsincss` plugin to load a JS-in-CSS stylesheet making use of this plugin. To test it in a JavaScript module, import both the `jsincss` package and any helper plugins you want:\n\n```html\n\u003cscript type=module\u003e\n  import jsincss from 'https://unpkg.com/jsincss/index.vanilla.js'\n  import protocol from 'https://unpkg.com/jsincss-protocol-sniffer/index.vanilla.js'\n\n  jsincss(() =\u003e `\n\n    ${protocol(['file'],`\n      body:before {\n        content: \"You're on FILE://\";\n      }\n    `)}\n    ${protocol(['http'],`\n      body:before {\n        content: \"You're on HTTP://\"\n      }\n    `)}\n    ${protocol(['https'],`\n      body:before {\n        content: \"You're on HTTPS://\"\n      }\n    `)}\n\n  `)\n\u003c/script\u003e\n```\n\nIt's also possible to write your stylesheets as a separate JavaScript module like this, where you import any helper plugins at the top of the stylesheet:\n\n```js\nimport protocol from 'https://unpkg.com/jsincss-protocol-sniffer/index.vanilla.js'\n\nexport default () =\u003e `\n\n  ${protocol(['file'],`\n    body:before {\n      content: \"You're on FILE://\";\n    }\n  `)}\n  ${protocol(['http'],`\n    body:before {\n      content: \"You're on HTTP://\"\n    }\n  `)}\n  ${protocol(['https'],`\n    body:before {\n      content: \"You're on HTTPS://\"\n    }\n  `)}\n\n`\n```\n\nAnd then import both the `jsincss` plugin and the stylesheet into your code and run them like this, suppling any `selector` or `events` list the `jsincss` plugin might need to apply the stylesheet only the the element(s) and event(s) you require, depending on what you're doing:\n\n```js\nimport jsincss from 'https://unpkg.com/jsincss/index.vanilla.js'\nimport stylesheet from './path/to/stylesheet.js'\n\njsincss(stylesheet)\n```\n\n## Compatible JS-in-CSS Stylesheet Loaders\n\n- [jsincss](https://github.com/tomhodgins/jsincss)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhodgins%2Fjsincss-protocol-sniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomhodgins%2Fjsincss-protocol-sniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhodgins%2Fjsincss-protocol-sniffer/lists"}