Skip to content
detailobsessedPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NearBites – Sort Uber Eats by Distance

A Chrome extension that adds a Distance button to Uber Eats, sorting restaurants by how close they are to your delivery address.

Features

  • 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

Install (from release)

  1. Download the latest nearbites-vX.Y.Z.zip from Releases
  2. Unzip the file
  3. Open chrome://extensions in Chrome (or your Chromium-based browser)
  4. Enable Developer mode (top-right toggle)
  5. Click Load unpacked and select the unzipped folder
  6. Navigate to ubereats.com and set a delivery address
  7. Click the green Distance button in the filter bar

Install (development)

  1. Clone this repo
  2. npm install
  3. Open chrome://extensions → Developer mode → Load unpacked → select this folder
  4. Navigate to ubereats.com and use the Distance button

How it works

  1. When the Uber Eats feed page loads, NearBites injects a Distance button into the filter bar
  2. On click, it calls the getFeedV1 API to get restaurant coordinates (mapMarker data)
  3. It auto-scrolls the page to trigger lazy-loading of all restaurant cards
  4. Each restaurant's URL slug (base64url-encoded UUID) is decoded and matched to API data
  5. Restaurants are sorted by haversine distance and displayed in an overlay
  6. Results are cached so reopening the panel or navigating back is instant

Project structure

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)

Development

Testing

npm test              # run tests once
npm run test:watch    # watch mode

Git hooks

Managed 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

Versioning

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 main auto-bumps manifest.json + package.json, commits, and tags

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages