A Chrome extension that adds a Distance button to Uber Eats, sorting restaurants by how close they are to your delivery address.
- Distance sorting — fetches restaurant coordinates from the Uber Eats API and sorts by straight-line distance using the haversine formula
- Distance badges — shows distance labels on every restaurant card in the feed
- Full overlay — opens a clean grid view of all restaurants ranked by proximity, with staggered entrance animations
- Auto-scroll — automatically scrolls the feed to load all available restaurants before sorting
- Caching — results are cached in memory (5 min TTL) so navigating away and back is instant; Shift+click to force refresh
- Toolbar popup — click the extension icon to see if NearBites is active on the current page
- Download the latest
nearbites-vX.Y.Z.zipfrom Releases - Unzip the file
- Open
chrome://extensionsin Chrome (or your Chromium-based browser) - Enable Developer mode (top-right toggle)
- Click Load unpacked and select the unzipped folder
- Navigate to ubereats.com and set a delivery address
- Click the green Distance button in the filter bar
- Clone this repo
npm install- Open
chrome://extensions→ Developer mode → Load unpacked → select this folder - Navigate to ubereats.com and use the Distance button
- When the Uber Eats feed page loads, NearBites injects a Distance button into the filter bar
- On click, it calls the
getFeedV1API to get restaurant coordinates (mapMarkerdata) - It auto-scrolls the page to trigger lazy-loading of all restaurant cards
- Each restaurant's URL slug (base64url-encoded UUID) is decoded and matched to API data
- Restaurants are sorted by haversine distance and displayed in an overlay
- Results are cached so reopening the panel or navigating back is instant
manifest.json Chrome extension manifest (Manifest V3)
content.js Content script — injected into ubereats.com pages
lib.js Pure utility functions (shared with tests via UMD)
lib.test.js Vitest unit tests for lib.js
popup.html Toolbar popup UI
popup.js Toolbar popup logic
package.json Dependencies and scripts
eslint.config.cjs ESLint configuration
prek.toml Git hooks (prek)
scripts/
bump-version.sh Local semantic-release (post-merge version bump)
npm test # run tests once
npm run test:watch # watch modeManaged with prek:
prek install
prek autoupdate| Hook | Stage | What it does |
|---|---|---|
| ESLint + Prettier | pre-commit | Lint and format JS/JSON/MD |
| Vitest | pre-merge-commit, pre-push | Tests must pass |
| Conventional commits | commit-msg | Enforces feat:, fix:, etc. |
| No direct commit | pre-commit | Blocks direct commits on main |
| Version bump | post-merge | Auto-bumps version on merge to main |
Versions follow semver 0.x.y (capped, never auto-bumps to 1.0.0):
feat:→ minor bump (0.x+1.0)fix:,refactor:, etc. → patch bump (0.0.y+1)- Merging to
mainauto-bumpsmanifest.json+package.json, commits, and tags
MIT