chrome-go-codes

Go Codes

A Chrome extension that maps short codes to URLs and triggers them from the omnibox. Mappings sync across devices via Chrome profile.

Type go in the address bar, hit space (or tab), enter a short code, press Enter — the active tab navigates to the mapped URL.

Features

Install (unpacked)

The Material Web bundle (src/vendor/material.js) is committed, so you can load the extension without a build step.

  1. Clone or download this repo.
  2. Open chrome://extensions.
  3. Toggle Developer mode (top right).
  4. Click Load unpacked and select the src/ directory.
  5. (Optional) Pin the extension from the puzzle-piece menu so the icon appears in the toolbar.

Development

The UI uses Material Web components. They’re bundled locally (the MV3 script-src 'self' CSP blocks remote scripts) into a single self-contained ESM file via esbuild.

npm install        # install @material/web + esbuild
npm run build      # bundle build/material-entry.js -> src/vendor/material.js
npm run watch      # rebuild on change (non-minified)

Edit build/material-entry.js to add or remove Material components from the bundle. Re-run npm run build and commit the regenerated src/vendor/material.js. The release workflow also rebuilds it from source before packaging.

Usage

Add a code

  1. Click the toolbar icon — opens the manage page.
  2. Enter a short code (no spaces) and a URL. URLs without a scheme get https:// prepended automatically.
  3. Click Add.

Use a code

In any new tab or the address bar:

go <space> <code> <Enter>

The active tab navigates to the URL mapped to <code>. Modifier keys (Ctrl/Cmd+Enter, etc.) follow Chrome’s standard omnibox behavior — open in new tab, background tab, etc.

Delete a code

Click the trash icon next to the row on the manage page.

Customizing the omnibox keyword

The keyword is hardcoded to go in src/manifest.json. Chrome does not allow runtime changes to manifest values. To change it:

  1. Edit src/manifest.jsonomnibox.keyword.
  2. Reload the extension at chrome://extensions.

File structure

build/
└── material-entry.js   esbuild entry — imports the Material Web components used
src/
├── manifest.json       MV3 manifest, omnibox + action config
├── background.js       Service worker: omnibox handler, toolbar click handler
├── manage.html         Manage UI markup (Material Web components)
├── manage.css          Material You (MD3) tokens + layout, adaptive light/dark
├── manage.js           CRUD logic against chrome.storage.sync
├── vendor/
│   └── material.js     Bundled @material/web (committed, regenerated by build)
└── icons/              16/48/128 PNGs

Storage schema

Each code is stored as its own top-level key in chrome.storage.sync (which is scoped per-extension, so no risk of collision with other extensions):

key:   "<shortcode>"
value: "<url>"

Keys starting with _ are reserved for future metadata (e.g., settings). User-entered codes cannot begin with _.

Limits (Chrome):

The extension caps users at 500 codes, leaving headroom.

Design notes

Roadmap ideas

License

MIT