|
| 1 | +# Blog Link Analyzer |
| 2 | + |
| 3 | +A browser extension that detects blog posts and extracts linked blog content with AI-powered summarization capabilities. |
| 4 | + |
| 5 | +## 🌟 Features |
| 6 | + |
| 7 | +- **Blog Detection**: Automatically identifies blog posts on any webpage |
| 8 | +- **Link Extraction**: Extracts all blog post links with titles and metadata |
| 9 | +- **AI Summarization**: Summarize current page and linked blogs using multiple AI providers |
| 10 | +- **Nested Exploration**: Multi-level link exploration with breadcrumb navigation |
| 11 | +- **Smart Filtering**: Filter by internal links, extracted content, and search functionality |
| 12 | +- **Export Options**: Export link data for further analysis |
| 13 | +- **Cross-Browser**: Works on Chrome (Manifest V3) and Firefox (Manifest V2) |
| 14 | + |
| 15 | +## 🌐 Browser Compatibility |
| 16 | + |
| 17 | +- **Chrome**: Manifest V3 compatible |
| 18 | +- **Firefox**: Manifest V2 compatible |
| 19 | +- **Edge**: Chrome Web Store compatible |
| 20 | +- **Safari**: Not currently supported |
| 21 | + |
| 22 | +## 📋 Requirements |
| 23 | + |
| 24 | +### Operating System |
| 25 | +- Windows 10+ or macOS 10.15+ or Ubuntu 18.04+ |
| 26 | + |
| 27 | +### Development Tools |
| 28 | +- **Node.js**: 16.0.0 or higher |
| 29 | +- **npm**: 8.0.0 or higher |
| 30 | +- **Git**: 2.0.0 or higher (for cloning) |
| 31 | + |
| 32 | +### Build Dependencies |
| 33 | +- **webpack**: 5.89.0+ (JavaScript bundling) |
| 34 | +- **archiver**: 6.0.1+ (ZIP file creation) |
| 35 | +- **web-ext**: 9.1.0+ (Firefox XPI generation) |
| 36 | +- **@babel/core**: 7.28.5+ (JavaScript transpilation) |
| 37 | +- **@babel/preset-env**: Latest (Browser compatibility) |
| 38 | + |
| 39 | +## 🚀 Installation |
| 40 | + |
| 41 | +### 1. Clone Repository |
| 42 | +```bash |
| 43 | +git clone https://github.com/codingnooob/blogbranch.git |
| 44 | +cd blogbranch |
| 45 | +``` |
| 46 | + |
| 47 | +### 2. Install Dependencies |
| 48 | +```bash |
| 49 | +npm install |
| 50 | +``` |
| 51 | + |
| 52 | +### 3. Verify Installation |
| 53 | +```bash |
| 54 | +npm run --help |
| 55 | +# Should show all available scripts |
| 56 | +``` |
| 57 | + |
| 58 | +## 🔧 Build Instructions |
| 59 | + |
| 60 | +### Development Build |
| 61 | +```bash |
| 62 | +npm run build:dev |
| 63 | +``` |
| 64 | +Creates development bundles with source maps and watches for changes. |
| 65 | + |
| 66 | +### Production Build |
| 67 | +```bash |
| 68 | +npm run build |
| 69 | +``` |
| 70 | +Creates optimized production bundles in `dist/` directory. |
| 71 | + |
| 72 | +### Create Chrome Extension |
| 73 | +```bash |
| 74 | +npm run package:chrome |
| 75 | +``` |
| 76 | +Creates `blog-link-analyzer-v1.1.0.zip` ready for Chrome Web Store upload. |
| 77 | + |
| 78 | +### Create Firefox Extension |
| 79 | +```bash |
| 80 | +npm run package:firefox |
| 81 | +``` |
| 82 | +Creates `blog-link-analyzer-firefox-v1.1.0.zip` ready for Firefox Add-ons upload. |
| 83 | + |
| 84 | +### Create All Package Formats |
| 85 | +```bash |
| 86 | +npm run package:all-formats |
| 87 | +``` |
| 88 | +Creates all package formats: |
| 89 | +- Chrome ZIP: `blog-link-analyzer-v1.1.0.zip` |
| 90 | +- Chrome CRX: `blog-link-analyzer-v1.1.0.crx` |
| 91 | +- Firefox ZIP: `blog-link-analyzer-firefox-v1.1.0.zip` |
| 92 | +- Firefox XPI: `blog-link-analyzer-firefox-v1.1.0.xpi` |
| 93 | + |
| 94 | +## 📁 Project Structure |
| 95 | + |
| 96 | +``` |
| 97 | +blogbranch/ |
| 98 | +├── 📄 Core Extension Files |
| 99 | +│ ├── manifest.json # Chrome manifest (V3) |
| 100 | +│ ├── manifest-firefox.json # Firefox manifest (V2) |
| 101 | +│ ├── popup.html # Main popup interface |
| 102 | +│ ├── popup.js, popup.css # Popup assets |
| 103 | +│ ├── ai-service.js # AI provider abstraction |
| 104 | +│ ├── storage-manager.js # Settings & caching |
| 105 | +│ └── content-fetcher.js # Content extraction |
| 106 | +├── 📁 Essential Directories |
| 107 | +│ ├── background/ # Service worker |
| 108 | +│ │ └── service-worker.js |
| 109 | +│ ├── content/ # Content scripts |
| 110 | +│ │ ├── blog-detector.js # Blog detection |
| 111 | +│ │ ├── link-extractor.js # Link extraction |
| 112 | +│ │ └── content-styles.css # Content styling |
| 113 | +│ ├── scripts/ # Build & packaging scripts |
| 114 | +│ ├── utils/ # Additional utilities |
| 115 | +│ └── icons/ # Extension icons |
| 116 | +├── 📦 Build Artifacts |
| 117 | +│ ├── *.zip, *.crx, *.xpi # Generated packages |
| 118 | +│ └── build-firefox/ # Temporary build dir |
| 119 | +├── 🔧 Configuration |
| 120 | +│ ├── package.json # Project configuration |
| 121 | +│ ├── webpack.config.js # Build configuration |
| 122 | +│ └── .gitignore # Git ignore rules |
| 123 | +└── 📚 Documentation |
| 124 | + ├── README.md # This file |
| 125 | + ├── LICENSE, PRIVACY.md # Legal documents |
| 126 | + └── *.md # Additional docs |
| 127 | +``` |
| 128 | + |
| 129 | +## 🤖 AI Functionality |
| 130 | + |
| 131 | +### Supported AI Providers |
| 132 | +- **OpenAI**: GPT-4, GPT-3.5-turbo, GPT-3.5 |
| 133 | +- **Anthropic**: Claude-3-sonnet, Claude-3-haiku, Claude-3-opus |
| 134 | +- **Ollama**: Local models (llama2, mistral, custom) |
| 135 | +- **Custom**: Any OpenAI-compatible API endpoint |
| 136 | + |
| 137 | +### AI Features |
| 138 | +- **Current Page Summary**: Summarize the blog post you're currently viewing |
| 139 | +- **Link Summaries**: Summarize individual blog posts from extracted links |
| 140 | +- **Batch Processing**: Summarize multiple links efficiently |
| 141 | +- **Caching**: Intelligent summary caching to reduce API calls |
| 142 | +- **Connection Testing**: Verify AI provider connectivity before use |
| 143 | +- **Custom Models**: Support for custom model configurations |
| 144 | + |
| 145 | +## 🛠️ Development |
| 146 | + |
| 147 | +### Local Development |
| 148 | +```bash |
| 149 | +npm run dev |
| 150 | +``` |
| 151 | +Starts development server with hot reloading and watches for file changes. |
| 152 | + |
| 153 | +### Testing |
| 154 | +```bash |
| 155 | +npm run test |
| 156 | +``` |
| 157 | +Runs the test suite with Jest framework. |
| 158 | + |
| 159 | +### Linting |
| 160 | +```bash |
| 161 | +npm run lint |
| 162 | +``` |
| 163 | +Checks code quality with ESLint. |
| 164 | + |
| 165 | +### Type Checking |
| 166 | +```bash |
| 167 | +npm run typecheck |
| 168 | +``` |
| 169 | +Validates TypeScript types (if applicable). |
| 170 | + |
| 171 | +### Validation |
| 172 | +```bash |
| 173 | +npm run validate |
| 174 | +``` |
| 175 | +Runs linting, type checking, and tests in sequence. |
| 176 | + |
| 177 | +## 📦 Build Process |
| 178 | + |
| 179 | +### Chrome Extension |
| 180 | +1. **Bundle Creation**: Webpack bundles popup.js and dependencies |
| 181 | +2. **Manifest Processing**: Uses manifest.json (Manifest V3) |
| 182 | +3. **File Packaging**: Includes all necessary files in ZIP |
| 183 | +4. **Output**: `blog-link-analyzer-v1.1.0.zip` |
| 184 | + |
| 185 | +### Firefox Extension |
| 186 | +1. **Structure Build**: Copies files to build-firefox/ directory |
| 187 | +2. **Manifest Conversion**: Converts to Manifest V2 format |
| 188 | +3. **Utils Organization**: Places AI files in utils/ directory |
| 189 | +4. **File Packaging**: Creates ZIP with Firefox-specific structure |
| 190 | +5. **XPI Generation**: Uses web-ext to create signed XPI |
| 191 | +6. **Output**: `blog-link-analyzer-firefox-v1.1.0.xpi` |
| 192 | + |
| 193 | +### Output Files |
| 194 | +- **Chrome ZIP**: `blog-link-analyzer-v1.1.0.zip` (~78KB) |
| 195 | +- **Chrome CRX**: `blog-link-analyzer-v1.1.0.crx` (~78KB) |
| 196 | +- **Firefox ZIP**: `blog-link-analyzer-firefox-v1.1.0.zip` (~78KB) |
| 197 | +- **Firefox XPI**: `blog-link-analyzer-firefox-v1.1.0.xpi` (~78KB) |
| 198 | + |
| 199 | +## 🔧 Configuration |
| 200 | + |
| 201 | +### Environment Variables |
| 202 | +- **NODE_ENV**: Set to 'production' for optimized builds |
| 203 | +- **EXTENSION_VERSION**: Automatically set from package.json |
| 204 | + |
| 205 | +### Customization |
| 206 | +- **AI Providers**: Configure in extension settings |
| 207 | +- **API Keys**: Set in extension popup settings |
| 208 | +- **Model Selection**: Choose specific models per provider |
| 209 | +- **Caching**: Enable/disable summary caching |
| 210 | + |
| 211 | +## 🐛 Troubleshooting |
| 212 | + |
| 213 | +### Common Build Issues |
| 214 | + |
| 215 | +#### Permission Denied |
| 216 | +```bash |
| 217 | +# Fix: Ensure proper file permissions |
| 218 | +chmod +x scripts/*.js |
| 219 | +``` |
| 220 | + |
| 221 | +#### Missing Dependencies |
| 222 | +```bash |
| 223 | +# Fix: Clean install |
| 224 | +rm -rf node_modules package-lock.json |
| 225 | +npm install |
| 226 | +``` |
| 227 | + |
| 228 | +#### Web-ext Not Found |
| 229 | +```bash |
| 230 | +# Fix: Install globally |
| 231 | +npm install -g web-ext |
| 232 | +``` |
| 233 | + |
| 234 | +### Firefox-Specific Issues |
| 235 | + |
| 236 | +#### Manifest Validation Errors |
| 237 | +- **Content Scripts**: Ensure all files exist in content/ directory |
| 238 | +- **Icons**: Verify all icon sizes are present in icons/ directory |
| 239 | +- **Permissions**: Check required permissions in manifest-firefox.json |
| 240 | + |
| 241 | +#### XPI Generation Fails |
| 242 | +- **Node Version**: Ensure Node.js 16+ is installed |
| 243 | +- **Build Directory**: Clean build-firefox/ directory first |
| 244 | +- **Web-ext Version**: Update to latest web-ext version |
| 245 | + |
| 246 | +### Chrome-Specific Issues |
| 247 | + |
| 248 | +#### Manifest V3 Errors |
| 249 | +- **Service Worker**: Ensure background/service-worker.js exists |
| 250 | +- **Action Handlers**: Verify proper action API usage |
| 251 | +- **CSP Rules**: Check content security policy compliance |
| 252 | + |
| 253 | +## 🤝 Contributing |
| 254 | + |
| 255 | +### Development Workflow |
| 256 | +1. Fork the repository |
| 257 | +2. Create a feature branch: `git checkout -b feature-name` |
| 258 | +3. Make changes and test thoroughly |
| 259 | +4. Run validation: `npm run validate` |
| 260 | +5. Commit changes: `git commit -m "Add feature description"` |
| 261 | +6. Push branch: `git push origin feature-name` |
| 262 | +7. Create pull request |
| 263 | + |
| 264 | +### Code Style |
| 265 | +- **Indentation**: 2 spaces |
| 266 | +- **Quotes**: Single quotes for strings |
| 267 | +- **Trailing Commas**: Required in objects/arrays |
| 268 | +- **Line Length**: Maximum 80 characters |
| 269 | +- **ESLint**: Follow project ESLint configuration |
| 270 | + |
| 271 | +## 📄 License |
| 272 | + |
| 273 | +MIT License - see [LICENSE](LICENSE) file for details. |
| 274 | + |
| 275 | +## 🔗 Links |
| 276 | + |
| 277 | +- **GitHub Repository**: https://github.com/codingnooob/blogbranch |
| 278 | +- **Chrome Web Store**: [Link when published] |
| 279 | +- **Firefox Add-ons**: [Link when published] |
| 280 | +- **Documentation**: https://codingnooob.github.io/blogbranch/ |
| 281 | +- **Issues**: https://github.com/codingnooob/blogbranch/issues |
| 282 | + |
| 283 | +## 📈 Version History |
| 284 | + |
| 285 | +- **v1.1.0**: AI summarization functionality, project structure optimization |
| 286 | +- **v1.0.2**: Initial release with basic blog detection |
| 287 | +- **v1.0.1**: Beta testing release |
| 288 | + |
| 289 | +## 📞 Support |
| 290 | + |
| 291 | +For issues, questions, or contributions: |
| 292 | +- **GitHub Issues**: https://github.com/codingnooob/blogbranch/issues |
| 293 | +- **Documentation**: See additional .md files in repository |
| 294 | +- **Privacy Policy**: See [PRIVACY.md](PRIVACY.md) |
| 295 | + |
| 296 | +--- |
| 297 | + |
| 298 | +**Built with ❤️ for the blogging community** |
0 commit comments