Skip to main content
You will build an Omnibox (address bar) shortcut. Type 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 (createdevbuild) that every project follows.

What you will build

The plan

Make GitHub search as fast as a native browser shortcut. The extension reserves the keyword gh; after you type gh and a query, it opens GitHub search results.

Step 1: create the extension

Use the Extension.js create command to scaffold a minimal extension named github-search.
Using Deno? Deno caches npm packages aggressively, including the @latest tag, so npm:extension@latest can keep resolving to an older cached release. If a scaffold or dev build fails with an error that a newer version already fixed (for example manifest.json references files that were not emitted to disk), pin the version or refresh the cache:
After deno install, confirm the resolved version (extension should match the latest release) before running deno task dev.

Step 2: create the manifest file

Every extension starts with a manifest file. It defines metadata, permissions, and runtime files. Based on the plan above, set the gh shortcut and add a service worker for user events.
  • omnibox.keyword: When you type gh, 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. Create service_worker.js:
The script above opens a new tab with GitHub search results whenever you type something after “gh” in the address bar.

Step 4: load your extension

Your package.json file now looks like this:
These scripts are the default Extension.js commands. Run the extension for the first time:
If your setup is correct, Extension.js launches Chrome with a fresh profile, loads 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.
You now have a working browser extension that searches on GitHub.

Step 5: make it better

Improve the search experience by adding suggestions directly in the address bar with an Omnibox input listener. Update service_worker.js to fetch GitHub suggestions and display them while typing.
service_worker.js
This code adds live GitHub suggestions directly in the address bar. You now have a working GitHub search extension. Iterate on it and adapt it to your own workflow.

Next steps