Skip to content

Repository files navigation

Themis

Status Version Platform

⚠️ This is a simplified overview, not legal advice. Themis shows the license GitHub detected for a repository — the repository's actual terms may differ, and a repository without a license falls under default copyright. Use it to get oriented quickly, not to settle a licensing question.


Themis is a browser extension that recognizes a repository's license on GitHub by itself and docks a window in the bottom-right corner summarizing what you can do with the repo, what you must do, and what its limitations are.

It stays out of your way by design. No account, no tracking, no build step — it reads what GitHub already shows you and explains it in plain language, in English or Czech.


What it shows

  • Permissions, conditions and limitations — the three things that actually decide whether you may use a repository, each with a one-line explanation
  • Classification — permissive, copyleft, weak copyleft, strong network copyleft, or public domain
  • License fingerprint — a colored bar sized by how many items fall into each of the three categories, so two licenses can be compared at a glance
  • 47 licenses — MIT, Apache-2.0, GPL/LGPL/AGPL, MPL, BSD, Unlicense, CC0 and the rest of the choosealicense.com set
  • Nothing at all — when the API limit is exhausted or the network is down, the extension prefers showing nothing over showing something uncertain

How it behaves

  • The window shows up on its own in the bottom-right corner when you open a repository. Nothing to click.
  • Collapses into a pill () with the license shorthand; the choice is remembered. Click the pill to expand it again. × hides the window until the next page.
  • Discreet where it would get in the way — only the pill on repo sub-pages (issues, PRs, files), the full window on the repository overview.
  • Follows the GitHub theme — light and dark, including GitHub's own theme switch.
  • Language follows your setting — English or Czech, defaulting to the browser language. Changing it in Settings applies to the open GitHub window immediately.
  • The popup is the fallback — it works outside GitHub too and can display any license from the list.
Control What it does
Gear (popup) Opens Settings (language selection)
in the window Collapses the window into a pill (remembered)
× in the window Hides the window until the next page
Click on the pill Expands the window again
Checkbox in the popup Turns automatic opening of the window off/on

Design philosophy

No build step. Plain JavaScript, no bundler, no dependencies. What you see in the repository is what runs in the browser — load the folder and it works.

Quiet about the network. The license is read straight from the repository page whenever possible, with no API call at all. Results are cached (12 h for a license that was found, 1 h for "no license") because unauthenticated GitHub API requests are capped at 60/hour.

Isolated from the page. The window renders in a shadow DOM, so its styles never mix with GitHub's and GitHub's never leak into it.

Localizable in one file. Every text — UI and license rule descriptions alike — lives in i18n.js. Missing keys fall back to English, so an unfinished translation still works.

Honest by default. Uncertain data is not displayed. The disclaimer is part of the panel, not buried in the store listing.


Installation (loading the unpacked extension)

Chrome / Edge / Brave

  1. Open chrome://extensions (in Edge edge://extensions).
  2. Turn on Developer mode in the top-right corner.
  3. Click Load unpacked and select the Themis folder.
  4. Open any repository on github.com – the window appears on its own.

Firefox (temporarily, until restart)

  1. In manifest.json replace "background": { "service_worker": "background.js" } with "background": { "scripts": ["background.js"] }.
  2. about:debugging#/runtime/this-firefoxLoad Temporary Add-on… → select manifest.json.

How it works

  1. On a repository page the content script first tries to read the license straight from the About section – instant, with no API call.
  2. When that isn't enough, it asks the service worker, which calls the GitHub API GET /repos/{owner}/{repo}/license (through the worker because of the GitHub page CSP).
  3. Results go into a shared cache; the unauthenticated API limit is 60 requests/hour.
  4. When the limit is exhausted or the network fails, the extension renders nothing.
  5. The permissions/conditions/limitations data comes from choosealicense.com (license-data.js); the texts and translations live in i18n.js.

Adding another language

  1. In i18n.js copy the block of one existing language in LOCALES (e.g. "en"), rename the key to the language code (e.g. "de") and translate the values (leave the keys alone). The rules section needs translating as well — label and description of every rule.
  2. Add { "code": "de", "name": "Deutsch" } to the TH_LANGS array.

That's it — the language shows up in Settings and can be selected. Missing keys fall back to English, so an unfinished translation still works.


Files

File Purpose
manifest.json Extension configuration (MV3)
content.js The docked window and the pill on GitHub
background.js Service worker: GitHub API requests and the cache
popup.html / popup.js Popup under the icon + the Settings screen
render.js Shared panel assembly + license lookup
i18n.js Localization: UI texts + rule translations (add languages here)
license-data.js Database of 47 licenses (generated)
popup.css Styles (shared by the window, the pill and the popup)
styles.js popup.css as a string for the shadow DOM (generated)
scripts/build_styles.py Regenerates styles.js from popup.css
test/ Tests of the window and popup behavior in jsdom

Development

python3 scripts/build_styles.py         # popup.css -> styles.js (after editing the CSS)

npm install jsdom
node test/test_dock.js                  # window behavior + localization
node test/test_popup.js                 # popup + Settings + language switching

After editing popup.css you have to run build_styles.py, otherwise the change won't show up in the window on the page.


Author: Tomáš Barták — github.com/batacek · batacek.eu

License data: © choosealicense.com, licensed under CC-BY-3.0

About

Themis is a browser extension that recognizes a repository's license on GitHub by itself and docks a window in the bottom-right corner summarizing what you can do with the repo, what you must do, and what its limitations are.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages