Below is a short client-facing guide on what to host and how to connect to the hosted backend.
You need to host the backend for the Chrome extension:
- Folder:
chrome_extension/backend - API endpoints:
GET /health— health checkPOST /predict— prediction (main endpoint)
- Go to the backend folder:
cd chrome_extension/backend - Install dependencies:
python -m pip install -r requirements.txt
- Start the server by running
run_chrome_extension_backend.batin main folder or use:By default, the extension expects the API atpython -m uvicorn app:app --host 127.0.0.1 --port 8000 --reload
http://127.0.0.1:8000.
- Deploy
chrome_extension/backendon a server with internet access. - Install dependencies and start the server (example):
cd chrome_extension/backend python -m pip install -r requirements.txt python -m uvicorn app:app --host 0.0.0.0 --port 8000 - Open port
8000(or another one if you use a different port) for external access. - Check availability:
curl http://<HOST>:8000/health
Update the base URL in the Chrome extension:
- Open
chrome_extension/extension/popup.js. - Find this line:
const API_BASE = "http://127.0.0.1:8000";
- Replace it with your server address, for example:
const API_BASE = "https://your-host.example.com";
After this, the extension will use the specified host.
This extension can be installed in Chrome only in Developer mode:
- Open
chrome://extensions/. - Enable Developer mode (top-right toggle).
- Click Load unpacked.
- Select the
chrome_extension/extensionfolder (the frontend lives there; you can also seeextension.crxin this folder).
If you need a packaged .crx file, you can pack it in Chrome:
- Open
chrome://extensions/. - Enable Developer mode.
- Click Pack extension.
- For Extension root directory, choose
chrome_extension/extension. - Click Pack extension to generate the
.crx(and.pem) file.
To install the packaged extension:
- Open
chrome://extensions/. - Drag and drop the generated
.crxfile into the page, or click Load unpacked if you still want to use the folder directly.