File size: 4,324 Bytes
5a81b95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# WidgeTDC Browser Extension

AI-powered browser assistant with semantic search and knowledge capture.

## Features

### 🎯 Smart Text Selection
- Select any text on a webpage
- Get instant AI-powered actions:
  - πŸ’Ύ **Save** - Store to your knowledge base
  - πŸ” **Search Similar** - Find related content
  - ❓ **Ask AI** - Get instant answers

### πŸ“š Page Capture
- Automatically capture page content
- Extract metadata (author, date, description)
- Store in semantic vector database
- Search across all captured content

### πŸ€– AI Assistant Sidebar
- Floating sidebar with AI capabilities
- Semantic search results
- AI-generated answers
- Beautiful, modern UI

### πŸ”— Backend Integration
- Connects to WidgeTDC platform
- Real-time semantic search
- Knowledge graph integration
- Multi-modal support

## Installation

### From Source

1. **Clone the repository**
   ```bash
   git clone https://github.com/your-org/WidgeTDC.git
   cd WidgeTDC/browser-extension
   ```

2. **Load in Chrome**
   - Open Chrome and go to `chrome://extensions/`
   - Enable "Developer mode" (top right)
   - Click "Load unpacked"
   - Select the `browser-extension` folder

3. **Configure Backend URL**
   - Click the extension icon
   - Go to Options
   - Set your WidgeTDC backend URL (default: `http://localhost:3000`)

## Usage

### Text Selection Actions

1. **Select text** on any webpage
2. **Floating buttons appear** with options:
   - Save to knowledge base
   - Search for similar content
   - Ask AI about the selection

### Page Capture

1. **Click extension icon**
2. **Select "Capture Page"**
3. Content is automatically:
   - Extracted and cleaned
   - Sent to backend
   - Indexed for search

### Sidebar

1. **Click extension icon** β†’ "Open Sidebar"
2. **Search** your knowledge base
3. **Ask questions** to AI
4. **View results** in beautiful interface

## Configuration

### Backend URL

Set in extension options:
```
Default: http://localhost:3000/api
Production: https://api.widgetdc.com/api
```

### Permissions

The extension requires:
- `activeTab` - Access current tab content
- `storage` - Store settings
- `contextMenus` - Right-click menu
- `tabs` - Manage tabs

## Development

### File Structure

```
browser-extension/
β”œβ”€β”€ manifest.json       # Extension manifest (v3)
β”œβ”€β”€ content.js         # Content script (injected)
β”œβ”€β”€ content.css        # Styles
β”œβ”€β”€ background.js      # Service worker
β”œβ”€β”€ popup.html         # Extension popup
β”œβ”€β”€ options.html       # Settings page
└── icons/            # Extension icons
```

### Building

No build step required - pure JavaScript!

### Testing

1. Make changes to files
2. Go to `chrome://extensions/`
3. Click "Reload" on WidgeTDC extension
4. Test on any webpage

## Features in Detail

### Smart Content Extraction

- Removes scripts, styles, ads
- Extracts main content only
- Preserves formatting
- Captures metadata

### Semantic Search

- Vector-based similarity
- Hybrid keyword + semantic
- Re-ranked results
- Cross-modal search

### AI Assistance

- Context-aware answers
- Multi-hop reasoning
- Knowledge graph integration
- Real-time responses

## Privacy

- **No data collection** - All data stays on your server
- **Local processing** - Content processed locally
- **Secure communication** - HTTPS only in production
- **User control** - You own your data

## Keyboard Shortcuts

- `Alt+S` - Save current page
- `Alt+F` - Open search sidebar
- `Alt+Q` - Quick AI question
- `Esc` - Close sidebar

## Troubleshooting

### Extension not working?

1. Check backend is running
2. Verify URL in options
3. Check browser console for errors
4. Reload extension

### No results in search?

1. Ensure content is captured
2. Wait for indexing (few seconds)
3. Try different search terms
4. Check backend logs

### Sidebar not appearing?

1. Check for conflicts with other extensions
2. Verify permissions granted
3. Try reloading the page
4. Check z-index conflicts

## Contributing

1. Fork the repository
2. Create feature branch
3. Make changes
4. Test thoroughly
5. Submit pull request

## License

MIT License - See LICENSE file

## Support

- **Issues**: GitHub Issues
- **Docs**: https://docs.widgetdc.com
- **Discord**: https://discord.gg/widgetdc

---

**Made with ❀️ by the WidgeTDC Team**