Skip to content

nocoo/hooky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

98 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Hooky logo

Hooky

๐Ÿช One-click webhook trigger with page context, template variables, and smart rules

Manifest V3 Coverage 95% 258 tests passing License MIT

Available in the Chrome Web Store


โœจ Features

  • ๐Ÿช Multiple webhook templates โ€” create, edit, and manage named templates with URL, HTTP method, and key-value parameters

  • ๐Ÿ”€ Template variables โ€” dynamically inject page context into parameter values:

    Variable Description
    {{page.url}} Current page URL
    {{page.title}} Page title
    {{page.selection}} Selected text
    {{page.meta.description}} Meta description
    {{page.meta.og:title}} Open Graph title
    {{page.meta.og:description}} Open Graph description
    {{page.meta.og:image}} Open Graph image
  • โšก Quick Send Rules โ€” define rules based on page URL or title to automatically fire the right webhook; first match wins, fallback opens popup

  • ๐Ÿ“‹ Context menu โ€” right-click on any page to trigger webhooks from the "Hooky" menu

  • ๐ŸŽจ Themes โ€” system / light / dark

  • ๐ŸŒ i18n โ€” 10 languages: English, ็ฎ€ไฝ“ไธญๆ–‡, ็น้ซ”ไธญๆ–‡, ๆ—ฅๆœฌ่ชž, ํ•œ๊ตญ์–ด, Franรงais, Deutsch, Espaรฑol, Portuguรชs (BR), ะ ัƒััะบะธะน

๐Ÿš€ Getting Started

Prerequisites

  • Bun v1.x+
  • Google Chrome

Install

bun install

The prepare script automatically runs husky to set up Git hooks.

Load in Chrome

  1. Navigate to chrome://extensions/
  2. Enable Developer mode (top-right toggle)
  3. Click Load unpacked โ†’ select the project root

๐Ÿ› ๏ธ Development

Scripts

Command What it does
bun run test ๐Ÿงช Run unit tests (Vitest)
bun run test:watch ๐Ÿ‘€ Run tests in watch mode
bun run test:coverage ๐Ÿ“Š Run tests with V8 coverage report (90% threshold)
bun run lint ๐Ÿ” Lint src/ and tests/ with ESLint
bun run test:e2e ๐ŸŒ Run Puppeteer E2E tests
bun run build ๐Ÿ“ฆ Package extension into dist/hooky-<version>.zip

Git Hooks (Husky) ๐Ÿถ

Hooks live in .husky/ and are shared across the team via Git.

Stage Command Purpose
pre-commit bun run test โœ… Catch regressions before commit
pre-push bun run test && bun run lint โœ… Full quality gate before push

Test Coverage ๐Ÿ“Š

Coverage is enforced at 90% for all four metrics:

-----------------|---------|----------|---------|---------|
File             | % Stmts | % Branch | % Funcs | % Lines |
-----------------|---------|----------|---------|---------|
All files        |   96.83 |    91.55 |   94.78 |   98.48 |
-----------------|---------|----------|---------|---------|

Project Structure ๐Ÿ“

hooky/
โ”œโ”€โ”€ ๐ŸŒ _locales/           # i18n messages (10 languages)
โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ assets/              # Logo, store descriptions, promo images
โ”œโ”€โ”€ ๐Ÿถ .husky/             # Git hooks (pre-commit, pre-push)
โ”œโ”€โ”€ ๐Ÿ”ง scripts/            # Utility scripts (icon generation)
โ”œโ”€โ”€ ๐Ÿ“ฆ src/
โ”‚   โ”œโ”€โ”€ background.js      # Service worker โ€” startup, rules dispatch
โ”‚   โ”œโ”€โ”€ contextmenu.js     # Context menu setup & click handling
โ”‚   โ”œโ”€โ”€ i18n.js            # i18n helpers (applyI18n, t)
โ”‚   โ”œโ”€โ”€ icons/             # Extension icons (16โ€“256px)
โ”‚   โ”œโ”€โ”€ options/           # โš™๏ธ Settings page (HTML, CSS, JS)
โ”‚   โ”œโ”€โ”€ pagecontext.js     # Page metadata extraction (injected on demand)
โ”‚   โ”œโ”€โ”€ params.js          # Request body / URL builder
โ”‚   โ”œโ”€โ”€ popup/             # ๐ŸชŸ Toolbar popup (HTML, CSS, JS)
โ”‚   โ”œโ”€โ”€ quicksend.js       # โšก Quick Send with badge feedback
โ”‚   โ”œโ”€โ”€ rules.js           # ๐Ÿ“ Rule engine (matchRule, findMatchingRule)
โ”‚   โ”œโ”€โ”€ store.js           # Storage CRUD, migration, settings
โ”‚   โ”œโ”€โ”€ template.js        # Template variable resolution engine
โ”‚   โ”œโ”€โ”€ theme.js           # ๐ŸŽจ Theme switching (system/light/dark)
โ”‚   โ””โ”€โ”€ webhook.js         # HTTP request executor
โ”œโ”€โ”€ ๐Ÿงช tests/
โ”‚   โ”œโ”€โ”€ *.test.js          # Unit tests (Vitest + jsdom)
โ”‚   โ””โ”€โ”€ e2e/               # Puppeteer E2E tests
โ”œโ”€โ”€ manifest.json          # Chrome Extension Manifest V3
โ”œโ”€โ”€ vitest.config.js       # Vitest + coverage config
โ”œโ”€โ”€ eslint.config.mjs      # ESLint flat config
โ””โ”€โ”€ package.json           # Scripts & dev dependencies

๐Ÿ“ฆ Publishing to Chrome Web Store

Build

bun run build

This produces dist/hooky-<version>.zip containing only the runtime files needed by Chrome.

Store Assets

Asset Location Status
๐Ÿ“ Description (EN) assets/description-en.txt โœ…
๐Ÿ“ Description (ZH) assets/description-zh.txt โœ…
๐Ÿ“ Description (JA) assets/description-ja.txt โœ…
๐Ÿ“ Description (KO) assets/description-ko.txt โœ…
๐Ÿ“ Description (ZH-TW) assets/description-zh-tw.txt โœ…
๐Ÿ“ Description (FR) assets/description-fr.txt โœ…
๐Ÿ“ Description (DE) assets/description-de.txt โœ…
๐Ÿ“ Description (ES) assets/description-es.txt โœ…
๐Ÿ“ Description (PT-BR) assets/description-pt-br.txt โœ…
๐Ÿ“ Description (RU) assets/description-ru.txt โœ…
๐Ÿ”’ Privacy Policy PRIVACY.md โœ…
๐Ÿ–ผ๏ธ Store Icon (128ร—128) src/icons/icon128.png โœ…
๐Ÿ–ผ๏ธ Promo Tile (440ร—280) assets/hooky-banner-440x280.png โœ…
๐Ÿ“ธ Screenshots (1280ร—800) assets/hooky-screenshot-1280x800-*.png โœ…

Steps

  1. Register at the Chrome Web Store Developer Dashboard ($5 one-time fee)
  2. Run bun run build to generate the ZIP
  3. Upload dist/hooky-<version>.zip
  4. Fill in listing details using the descriptions in assets/
  5. Set privacy policy URL to https://github.com/nocoo/hooky/blob/main/PRIVACY.md
  6. Upload promo tile (440ร—280) and at least 1 screenshot (1280ร—800 or 640ร—400)
  7. Submit for review (typically 1โ€“3 business days)

๐Ÿ“„ License

MIT

About

๐Ÿ™ Chrome extension to configure and trigger webhooks from the toolbar, context menu, or Quick Send

Resources

License

Stars

Watchers

Forks

Contributors