You will build an Omnibox (address bar) shortcut. TypeDocumentation Index
Fetch the complete documentation index at: https://extension.js.org/llms.txt
Use this file to discover all available pages before exploring further.
gh in the address bar, enter a query, and land on GitHub search results. Along the way you will wire a manifest.json and handle input in a background service worker. You will also practice the dev loop (create → dev → build) that every project follows.
What you will build
| Capability | What you get |
|---|---|
| Omnibox keyword flow | Trigger extension behavior with gh from the browser URL bar |
| Background event handling | Handle user input through a service worker |
| Local dev loop | Run, load, and validate extension behavior quickly |
| Progressive enhancement | Add live GitHub suggestions after baseline flow works |
The plan
Make GitHub search as fast as a native browser shortcut. The extension reserves the keywordgh; after you type gh and a query, it opens GitHub search results.
Step 1: create the extension
Use the Extension.jscreate command to scaffold a minimal extension named github-search.
Step 2: create the manifest file
gh shortcut and add a service worker for user events.
omnibox.keyword: When you typegh, the browser fires an event.background.service_worker: Listens to the event you triggered.
Step 3: create the background service worker
In browser extensions, the background service worker (a script that runs independently of any visible page) handles browser events. For this example, add a script that listens to Omnibox input and routes the query to GitHub search. Createservice_worker.js:
Step 4: load your extension
Yourpackage.json file now looks like this:
github-search as an unpacked extension, and prints a ready banner in your terminal. The Chrome address bar now recognizes gh as a keyword.
Type gh followed by a space, enter extension.js, press Enter. A new tab opens to https://github.com/search?q=extension.js&type=issues.
Step 5: make it better
Improve the search experience by adding suggestions directly in the address bar with an Omnibox input listener. Updateservice_worker.js to fetch GitHub suggestions and display them while typing.
service_worker.js
Next steps
- Create another extension with templates.
- Add automated checks with Playwright E2E.
- Review Troubleshooting, Security checklist, and Performance playbook as your extension grows.

