Shopping Copilot is a Chromium Manifest V3 extension built as an Analysis of Algorithms project.
The production flow is intentionally simple:
Right-click Amazon product -> extract product data -> search Mercado Libre -> rank offers -> show best matches
The academic flow adds a Mock Mode that runs the same ranking algorithm over a simulated dataset of 1,000,000 Mercado Libre-style offers and shows benchmark charts generated with Matplotlib.
- Chrome/Chromium MV3 extension.
- Context menu action:
Shopping Copilot. - Native side panel optimized for a narrow browser panel.
- Production Mode:
- extracts product title, price, image, and URL from Amazon product pages or listing cards.
- opens an inactive Mercado Libre results tab.
- scrapes visible offer cards from Mercado Libre Colombia.
- ranks the scraped offers with the project ranking algorithm.
- Mock Mode:
- uses a simulated dataset with 1,000,000 realistic offers.
- runs benchmarks with input sizes calculated from the dataset size, for example
1,000,5,000,10,000,25,000,50,000,100,000,250,000,500,000, and1,000,000. - opens an analysis popup with runtime and
O(n log n)reference charts.
- Single focused production flow with no backend server or external scraping service.
The main algorithm lives in:
src/core/ranking.ts
It receives:
- one detected Amazon product.
- a list of Mercado Libre offers.
- a result limit.
It performs:
- Text normalization and similarity scoring.
- Price relevance scoring.
- Small bonus for free shipping.
- Filtering of weak matches.
- Explicit Merge Sort by score descending and price ascending.
- Final top-k selection.
Complexity:
Text comparison: O(n * m)
Merge Sort: O(n log n)
Total: O(n * m + n log n)
If m is bounded: O(n log n)
Space: O(n)
Where:
nis the number of offers.mis the average product-title length.
public/
icons/ Extension icons
analysis/ Matplotlib PNG charts used by analysis popup
scripts/
build-extension.mjs Builds background/content scripts and copies extension assets
generate_algorithm_charts.py
src/
analysis/ Algorithm-analysis popup UI
background/ MV3 service worker and extension orchestration
content/ Amazon extraction and Mercado Libre result scraping
core/ Ranking algorithm, benchmark, money/text/storage/types
mock/ Simulated offer dataset for Mock Mode
panel/ Extension side panel UI
analysis.html Vite entry for analysis popup
panel.html Vite entry for side panel
public/manifest.json Chrome extension manifest
- Node.js 18 or newer.
- npm.
- Python with Matplotlib only if charts need to be regenerated.
npm installCharts are already included in public/analysis, but they can be regenerated with:
npm run chartsIf Matplotlib is missing:
python -m pip install matplotlibnpm run buildThe production extension is generated in:
dist/
- Open
chrome://extensions. - Enable Developer mode.
- Click
Load unpacked. - Select the
distfolder.
- Open an Amazon product page or Amazon search/listing page.
- Right-click the exact product title, image, or card.
- Choose
Shopping Copilot. - The side panel opens and shows ranked Mercado Libre offers.
- Open the side panel.
- Switch from
ProductiontoMock. - Click
Run benchmark. - Click
Open analysisto view the benchmark table and charts.
npm run build
npm run typecheck
npm run lint
npm run chartsnode_modules/anddist/are ignored by Git.- To submit source code, include the project files except
node_modules/. - To submit a ready-to-load extension, run
npm run buildand include the generateddist/folder.