From 8125db65fab51b7c26e73bfe97806080eaa65e6f Mon Sep 17 00:00:00 2001 From: Zetaphor Date: Sat, 25 Jan 2025 23:36:51 -0600 Subject: [PATCH] Add readme and icon --- README.md | 128 ++++++++++++++++++++++++++++++++++++++++ extension/icon.png | Bin 0 -> 2582 bytes extension/manifest.json | 8 ++- terminal | 1 - 4 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 README.md create mode 100644 extension/icon.png delete mode 100644 terminal diff --git a/README.md b/README.md new file mode 100644 index 0000000..1cac574 --- /dev/null +++ b/README.md @@ -0,0 +1,128 @@ +# Browser Recall + +Browser Recall is a browser history and bookmark management system that captures, processes, and stores web page content in a searchable format. It consists of a browser extension and a FastAPI backend server that work together to provide the ability to search your the content of your browsing history and bookmarks. + +## Features + +- 🔍 Full-text search across browsing history and bookmarks +- 📝 Automatic conversion of web pages to markdown format +- 🔄 Real-time page content capture via WebSocket +- ⚡ Optimized SQLite database with FTS5 search +- 🛡️ Configurable domain exclusions +- 📊 Efficient content processing and storage + +## System Architecture + +### Backend Components + +- **FastAPI Server**: Main application server handling WebSocket connections and HTTP endpoints +- **SQLite Database**: Stores history and bookmarks with full-text search capabilities +- **Page Reader**: Converts HTML content to markdown format +- **History Scheduler**: Background task for updating browser history +- **Configuration System**: Manages domain exclusions and reader settings + +### Browser Extension + +- **Content Script**: Captures page content and sends to backend +- **Background Script**: Manages WebSocket connection and message handling +- **Manifest**: Extension configuration and permissions + +## Setup + +### Prerequisites + +- Python 3.8+ +- Firefox Browser (for the extension) +- SQLite3 + +### Installation + +1. Clone the repository: +```bash +git clone +cd browser-recall +``` + +2. Create and activate a virtual environment: +```bash +python -m venv venv +source venv/bin/activate # On Windows: venv\Scripts\activate +``` + +3. Install dependencies: +```bash +pip install -r requirements.txt +``` + +4. Install the browser extension: + - Open Firefox + - Navigate to `about:debugging` + - Click "This Firefox" + - Click "Load Temporary Add-on" + - Select the `manifest.json` file from the `extension` directory + +### Configuration + +1. Configure domain exclusions in `app/config.yaml`: +```yaml +ignored_domains: + - "localhost" + - "127.0.0.1" + - "*.local" + # Add more patterns as needed +``` + +2. Configure the server port in `main.py` (default: 8523) + +## Usage + +1. Start the server: +```bash +python main.py +``` + +2. The extension will automatically: + - Capture page content as you browse + - Send content to the backend server + - Update history and bookmarks + +3. Access the API endpoints: + - Search history: `GET /history/search` + - Search bookmarks: `GET /bookmarks/search` + - Advanced search: `GET /history/search/advanced` + - Manage ignored domains: `GET/POST/DELETE /config/ignored-domains` + +## API Documentation + +### History Endpoints + +- `GET /history/search` + - Query parameters: + - `domain`: Filter by domain + - `start_date`: Filter by start date + - `end_date`: Filter by end date + - `search_term`: Full-text search + - `include_content`: Include markdown content + +- `GET /history/search/advanced` + - Advanced full-text search using SQLite FTS5 syntax + +### Bookmark Endpoints + +- `GET /bookmarks/search` + - Query parameters: + - `domain`: Filter by domain + - `folder`: Filter by folder + - `search_term`: Search in titles + +### Configuration Endpoints + +- `GET /config/ignored-domains`: List ignored domains +- `POST /config/ignored-domains`: Add domain pattern +- `DELETE /config/ignored-domains/{pattern}`: Remove domain pattern + +## Development + +- Logs are stored in the `logs` directory +- Database file: `browser_history.db` +- WebSocket endpoint: `ws://localhost:8523/ws` \ No newline at end of file diff --git a/extension/icon.png b/extension/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..68d968ebd10386d76d8a15fb1422b9081fa925b3 GIT binary patch literal 2582 zcma);dpMMN8^`Zwo*8p8W+r8vhN&FODHY|A(dyukM3S>Mht?rdNmL%%-LzWK!A_ct zq@sgECqjA@7HbzTBFA|kwbx$PUe|m7aeqJG`?~-6{rc!eHU>?V z1^^8E?RKsJgheC(5nU9yJ@xgA!gO)ky=74sV{UG4dU|?(em(@H~W_+ugBU!@Z8tJtp!*7sDtMgPDa82kjtB=N*^zvk|s%-4iqFNBg!jZH+$K zi8gDV`+A61-YOZQov0a(@!j`@Ch93Llp5+RR$i7!pN@19WYs+}qUG2hZ1~dl75doV z6fvbjU|~Sy0Yc%!zhfvgmoFDE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a45Y4xt^nIPtPmB*}fJv<*- zZJ|ds9=`val#|&xls9+d@Ul8nowOyZZ8O#+3bq}36bCJ27K!-tVU(YU=Cye+`A2RB zJ|RF@2_&1|E`1!PcMuz@T~z>{*ZG%h?O!-tzk^603G+4h@f{VnsLgtDU}da(hs>iG zkjv0)ylY>{@?vQ~6wV{+t)V zgk>FC6-ehZCcb;O5$kM!X{29=AW@%fFLo$ls$CmDjy-t=OQRj!&pliy>lnGfPqR?n zrI-2wLO)XXhux5c>1XEZj0M*ouuE@JYuxJjwn}6~sHzIlD4<>Q+NB?RK;8GM_ak)v z%SQXvOOGJy(@W!)_*fFMucXqob~UPn*S@8ty%U~ADa#Wd+K_SU>V%Z@o7SZPMIT|= zp;(|*N=q++MIeL>X~XNiHB>vv&FXPz4i0TXAxWdA$_NpYm9e`7zARONl=xIV4mhum zHoG!GczaNve{R|0vXt-2A7FfFOkbgj4tOXNgA#tMchl)T-qFwS zFI+MdSC*68Ff=-&B`s4EkMEE+bjS|TD7T?{D&X*Ch1K2Up%Wi zT3!SnoXAu78SV-CqshoK*<%n+sF|01(;Np`g!l9Hm!@>x`b2G;z$Q$xvupO^$B{R)w0q^IM?oEUr%39c6p16eK2YL_ffWfU^e9L+$7)DCqebTXEY`77 zFff8ch)YxCAOU|fZO?(Wakr+X2lHf?O{Z}GY8mWod0f1fH}CTGf%aRR?Fu#rB>fK; C)-418 literal 0 HcmV?d00001 diff --git a/extension/manifest.json b/extension/manifest.json index 7450313..9459659 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,8 +1,12 @@ { "manifest_version": 2, - "name": "Page Content Sender", + "name": "Browser Recall Helper", "version": "1.0", - "description": "Sends page content via WebSocket when a page loads", + "description": "Sends page visited content to the browser recall server to be saved as markdown", + "icons": { + "48": "icon.png", + "96": "icon.png" + }, "permissions": [ "webNavigation", "activeTab", diff --git a/terminal b/terminal deleted file mode 100644 index 613357b..0000000 --- a/terminal +++ /dev/null @@ -1 +0,0 @@ -rm app/websocket_server.py \ No newline at end of file