Community database for "link hints" in keyboard-based browsing
  • TypeScript 86.8%
  • Nix 13.2%
Find a file
2026-11-04 23:40:02 +01:00
.github/workflows feat: initial ci 2026-11-03 12:35:00 +01:00
integrations/glide feat: add exclude elements 2026-11-04 23:40:02 +01:00
schema feat: add exclude elements 2026-11-04 23:40:02 +01:00
scripts feat: add exclude elements 2026-11-04 23:40:02 +01:00
sites feat: add commonly used sites 2026-11-04 23:12:59 +01:00
src feat: add exclude elements 2026-11-04 23:40:02 +01:00
test feat: add exclude elements 2026-11-04 23:40:02 +01:00
.gitignore feat: Initial commit 2026-10-31 15:42:00 +01:00
.prettierrc.json feat: Initial commit 2026-10-31 15:42:00 +01:00
CONTRIBUTING.md feat: add exclude elements 2026-11-04 23:40:02 +01:00
flake.lock feat: Initial commit 2026-10-31 15:42:00 +01:00
flake.nix feat: add glide support 2026-11-02 18:48:00 +01:00
LICENSE feat: Initial commit 2026-10-31 15:42:00 +01:00
package-lock.json feat: Initial commit 2026-10-31 15:42:00 +01:00
package.json feat: test against live pages 2026-11-02 21:20:00 +01:00
README.md feat: add exclude elements 2026-11-04 23:40:02 +01:00

hint-selectors

A community "database" of CSS selectors for "hints" in keyboard-based browsing :)

Format

Every domain is handled by a sites/<domain>.json file that holds all rules for it and its subdomains:

{
  "domain": "github.com",
  "rules": [
    { "include": "[class*=\"TreeView-item-content-text\"]" },
    { "exclude": "footer" },
    {
      "match": ["*://github.com/*/issues*"],
      "sets": { "primary": "[data-listview-item-title-container] a" }
    }
  ]
}
  • include: hinted in addition to the default hintable elements
  • exclude: removed from the default hintable elements and from include
  • sets.primary: hinted exclusively, the main links of a page
  • match: optional match patterns limiting a rule to some pages

Usage

Currently only the Glide browser is supported, but contributions for Tridactyl, qutebrowser, ... etc. are very welcome :)

Glide

You need hint-selectors.glide.ts. Then:

glide.include("hint-selectors.glide.ts").then(() => glide.g.hint_selectors!.setup());

Configuration

By default, f and F show the default hints plus the site's include.

setup can be customized:

  • keys.include: keys showing the default hints plus include minus exclude + optional hint action
  • keys.primary: key hinting only the primary set, unbound by default
  • hint: receives { selector?, include?, exclude?, action? }, to route through your own hint function
  • extra: local rules, keyed by domain
  • remote: fetch updates instead of only using only the bundled data (off by default)

For example, it might look something like:

setup({
  keys: {
    include: [{ key: "f" }, { key: "F", action: "newtab-click" }],
    primary: "c",
  },
  hint: ({ selector, include, action }) => start_hints({ selector, include, action }),
  extra: {
    "about.example": [{ include: ".clickable-row" }],
  },
  remote: {
    url: "https://raw.githubusercontent.com/Swarsel/hint-selectors/dist/selectors.json",
    refresh_hours: 24,
  },
});