Home - Life-Experimentalist/NovelSynth GitHub Wiki
Welcome to the comprehensive documentation for NovelSynth - the AI-powered browser extension that enhances your reading experience across the web.
- Getting Started
- Installation Guide
- User Manual
- Developer Documentation
- AI Providers & Configuration
- Supported Websites
- API Reference
- Troubleshooting
- Contributing
- Changelog
NovelSynth is an intelligent browser extension that uses AI to enhance your reading experience on websites containing long-form content like novels, articles, and technical documentation. It can:
- Enhance Content: Improve grammar, style, and readability
- Summarize: Create concise summaries of long articles
- Analyze: Provide insights about content structure and themes
- Toggle Views: Switch between original and enhanced content
- Cross-Platform: Works on Chrome, Firefox, and Edge
- Multiple AI providers (Google Gemini, OpenAI, Anthropic)
- Context-aware content processing
- Maintains original meaning while improving readability
- Automatic detection of content-rich websites
- Specialized handlers for popular platforms
- Custom content extraction algorithms
- Content saved across sessions
- Quick toggle between original/enhanced versions
- Offline access to processed content
- Choose your preferred AI provider
- Adjust enhancement intensity
- Configure auto-enhancement rules
-
Download the Extension
# Clone the repository git clone https://github.com/LifeExperimentalist/novelsynth.git cd novelsynth # Install dependencies npm install # Build the extension npm run build
-
Load in Browser
- Open
chrome://extensions/
(oredge://extensions/
) - Enable "Developer mode"
- Click "Load unpacked"
- Select the
dist
folder
- Open
-
Configure API Keys
- Click the NovelSynth extension icon
- Navigate to Settings
- Add your AI provider API keys
-
Build for Firefox
npm run build:firefox npm run package:firefox
-
Install Add-on
- Open
about:debugging
- Click "This Firefox"
- Click "Load Temporary Add-on"
- Select the generated
.xpi
file
- Open
Visit the browser extension stores:
- Chrome Web Store (Coming Soon)
- Firefox Add-ons (Coming Soon)
- Edge Add-ons (Coming Soon)
NovelSynth requires API access to AI providers:
Google Gemini (Recommended)
- Visit Google AI Studio
- Create a new API key
- Copy the key to NovelSynth settings
OpenAI (Optional)
- Visit OpenAI Platform
- Generate a new secret key
- Add to NovelSynth settings
- Primary AI Provider: Select your preferred AI service
- Enhancement Mode: Choose between "Improve", "Grammar", "Style", etc.
- Auto-Enhancement: Enable automatic processing on supported sites
- Content Types: Select which types of content to process
- Visit any supported website
- Right-click on text content
- Select "Enhance with NovelSynth"
- Wait for processing to complete
- Click the NovelSynth icon in your browser toolbar
- Choose your desired action:
- 🚀 Enhance Content: Improve the current page
- 📝 Summarize: Create a summary
- 🔄 Toggle View: Switch between original/enhanced
- ⚙️ Settings: Configure preferences
-
Ctrl+Shift+E
(Windows/Linux) orCmd+Shift+E
(Mac): Enhance content -
Ctrl+Shift+S
(Windows/Linux) orCmd+Shift+S
(Mac): Summarize -
Ctrl+Shift+T
(Windows/Linux) orCmd+Shift+T
(Mac): Toggle view
- Toggle Banner: Appears after enhancement, allows switching views
- Original/Enhanced Indicator: Shows current view state
- Word Count: Displays before/after word counts
- Enhanced content is automatically saved
- Access stored content from the popup
- Clear storage to free up space
- Export enhanced content (Coming Soon)
NovelSynth follows a modular architecture designed for extensibility and maintainability:
NovelSynth/
├── src/
│ ├── background.ts # Extension lifecycle management
│ ├── content.ts # Page content manipulation
│ ├── popup.ts # User interface
│ ├── services/ # AI service integrations
│ │ ├── ai/
│ │ │ ├── BaseAIService.ts
│ │ │ ├── GeminiService.ts
│ │ │ └── AIServiceManager.ts
│ ├── utils/ # Core utilities
│ │ ├── ContentProcessor.ts
│ │ ├── StorageManager.ts
│ │ ├── ProcessingBanner.ts
│ │ └── website-handlers/ # Site-specific handlers
│ └── types/ # TypeScript definitions
├── manifest.json # Extension manifest
├── popup.html # Popup interface
└── webpack.config.js # Build configuration
Manages extension lifecycle, handles API requests, and coordinates between components.
class BackgroundScript {
// Handles extension installation and updates
private handleFirstInstall(): void
// Processes messages from content scripts and popup
private handleMessage(message: any, sender: chrome.runtime.MessageSender): Promise<any>
// Manages context menus
private setupContextMenus(): void
}
Injected into web pages to detect and process content.
class ContentScript {
// Main content enhancement pipeline
private async handleEnhanceContent(options: any): Promise<void>
// Toggle between original and enhanced content
private async handleToggleContent(): Promise<void>
// Detect if current page has processable content
private autoDetectContent(): void
}
Abstracts AI provider interactions and manages multiple services.
class AIServiceManager {
// Process content using selected AI provider
async enhanceContent(content: string, options: EnhancementOptions): Promise<ProcessingResult>
// Generate content summaries
async summarizeContent(content: string, options: SummarizationOptions): Promise<ProcessingResult>
// Analyze content structure and themes
async analyzeContent(content: string): Promise<ContentAnalysis>
}
// src/services/ai/YourAIService.ts
export class YourAIService extends BaseAIService {
provider: AIProvider = {
name: "Your AI Service",
id: "your-ai",
apiEndpoint: "https://api.yourai.com",
requiresAuth: true,
authType: "api_key",
features: ["enhance", "summarize"],
models: ["model-1", "model-2"],
defaultModel: "model-1"
};
async enhanceContent(content: string, options: EnhancementOptions): Promise<ProcessingResult> {
// Implementation here
}
}
// src/services/ai/AIServiceManager.ts
this.services.set('your-ai', new YourAIService());
// src/utils/website-handlers/YourSiteHandler.ts
export class YourSiteHandler extends BaseWebsiteHandler {
canHandle(): boolean {
return window.location.hostname.includes('yoursite.com');
}
extractContent(): string {
// Site-specific content extraction
}
extractTitle(): string {
// Site-specific title extraction
}
}
// src/utils/ContentProcessor.ts
private detectWebsiteHandler(): void {
const handlers = [
new YourSiteHandler(),
new FanfictionHandler(),
// ... other handlers
];
}
npm run build:dev # Development build with source maps
npm run watch # Watch mode for development
npm run dev # Development server with auto-reload
npm run build # Production build
npm run package # Create distribution packages
npm run test # Run test suite
npm run test:types # TypeScript type checking
npm run test:extension # Extension functionality tests
npm run lint # Code quality checks
Supported Models:
-
gemini-1.5-pro
: Best for complex content enhancement -
gemini-1.5-flash
: Faster processing, good for summaries -
gemini-pro
: Standard model for general use -
gemini-pro-vision
: Image and text processing (future feature)
Configuration:
{
"provider": "gemini",
"model": "gemini-1.5-pro",
"temperature": 0.7,
"maxTokens": 8192,
"features": ["enhance", "summarize", "analyze", "suggestions"]
}
API Key Setup:
- Visit Google AI Studio
- Create project and enable Gemini API
- Generate API key
- Add to NovelSynth settings
Supported Models:
-
gpt-4-turbo
: Best quality for enhancement -
gpt-4
: High-quality processing -
gpt-3.5-turbo
: Cost-effective option
Configuration:
{
"provider": "openai",
"model": "gpt-4-turbo",
"temperature": 0.3,
"maxTokens": 4000,
"features": ["enhance", "summarize"]
}
Planned Models:
-
claude-3-opus
: Premium model -
claude-3-sonnet
: Balanced performance -
claude-3-haiku
: Fast processing
- FanFiction.Net: Full support with chapter navigation
- Archive of Our Own: Content extraction and enhancement
- Wattpad: Story content processing
- Royal Road: LitRPG and fantasy novel support
- Webnovel: Popular light novel platform
- Medium: Blog post enhancement
- Wikipedia: Article improvement
- News Sites: General article processing
- Technical Blogs: Code-aware enhancement
- GitHub README: Markdown processing
- GitBook: Documentation enhancement
- Confluence: Wiki content improvement
To add support for a new website:
-
Create Handler Class
export class NewSiteHandler extends BaseWebsiteHandler { canHandle(): boolean { return window.location.hostname.includes('newsite.com'); } extractContent(): string { // Implement content extraction logic const contentElement = document.querySelector('.main-content'); return contentElement?.textContent || ''; } extractTitle(): string { return document.querySelector('h1.title')?.textContent || document.title; } }
-
Register in ContentProcessor
private detectWebsiteHandler(): void { const handlers = [ new NewSiteHandler(), // ... existing handlers ]; }
-
Test and Submit PR
- Test on the target website
- Ensure content extraction works correctly
- Submit pull request with handler
class StorageManager {
// Store enhanced content
static async storeContent(
url: string,
originalContent: string,
enhancedContent: string,
metadata: ContentMetadata
): Promise<void>
// Retrieve stored content
static async getStoredContent(): Promise<Record<string, ContentStorage>>
// Clear content for specific URL
static async clearStoredContent(url: string): Promise<void>
// Get storage statistics
static async getStorageStats(): Promise<StorageStats>
}
interface ContentStorage {
originalContent: string;
enhancedContent: string;
metadata: ContentMetadata;
timestamp: string;
}
interface ContentMetadata {
timestamp: string;
provider: string;
model: string;
contentType: ContentType;
websiteId: string;
processingTime?: number;
}
class ProcessingBanner {
constructor(config: BannerConfig)
// Show processing state
showProcessing(message: string): void
// Show success state with toggle
showSuccess(message: string): void
// Show error state
showError(message: string): void
// Update progress
updateProgress(percentage: number): void
// Remove banner
destroy(): void
}
class ContentProcessor {
// Process current page content
async processCurrentPage(options: ProcessingOptions): Promise<ProcessingResult>
// Check if current page can be processed
canHandleCurrentPage(): boolean
// Replace page content
replacePageContent(content: string): void
// Toggle content display state
isShowingEnhanced(): boolean
setShowingEnhanced(enhanced: boolean): void
}
- Check browser developer mode is enabled
- Verify all required files are in
dist
folder - Check console for TypeScript compilation errors
- Ensure manifest.json permissions are correct
- Check API Key: Verify key is correct and has proper permissions
- Network Issues: Check internet connection and firewall settings
- Rate Limits: Wait if you've exceeded API rate limits
- Content Size: Large content may need to be processed in chunks
- Website Support: Check if site has a dedicated handler
- Content Structure: Verify page has extractable text content
- JavaScript Loading: Ensure content is fully loaded before processing
- Ad Blockers: Some ad blockers may interfere with content detection
Enable debug mode for detailed logging:
// In browser console
localStorage.setItem('novelsynth-debug', 'true');
- Switch to faster AI model (e.g.,
gemini-1.5-flash
) - Reduce content chunk size in settings
- Check system resources and close unnecessary tabs
- Clear extension storage if full
- Regularly clear stored content
- Disable auto-enhancement on resource-constrained devices
- Use content chunking for very large documents
- Check Documentation: Review this wiki thoroughly
- GitHub Issues: Search existing issues or create new one
- Debug Logs: Include debug logs when reporting issues
- System Info: Provide browser version and extension version
-
Clone Repository
git clone https://github.com/LifeExperimentalist/novelsynth.git cd novelsynth
-
Install Dependencies
npm install
-
Development Build
npm run dev
- Use strict type checking
- Document all public methods
- Follow consistent naming conventions
- Write unit tests for new features
- Test on multiple browsers
- Verify website handler compatibility
- Update this wiki for new features
- Include code examples
- Document breaking changes
- New AI provider integrations
- Website handler development
- Performance optimizations
- Bug fixes and stability improvements
- UI/UX improvements
- Additional enhancement modes
- Mobile browser support
- Internationalization
- Advanced analytics
- Content export features
- Browser sync integration
- Premium features
- Fork Repository
-
Create Feature Branch
git checkout -b feature/your-feature-name
- Make Changes with tests
- Update Documentation
- Submit Pull Request
- ✅ Initial release with Google Gemini support
- ✅ FanFiction.Net handler implementation
- ✅ Content enhancement and summarization
- ✅ Toggle between original/enhanced content
- ✅ Cross-browser compatibility (Chrome, Firefox, Edge)
- ✅ Persistent content storage
- ✅ Context menu integration
- 🔄 OpenAI GPT-4 integration
- 🔄 Additional website handlers (AO3, Wattpad)
- 🔄 Enhanced UI with React components
- 🔄 Performance optimizations
- 🔄 Improved error handling
- 🔄 Anthropic Claude integration
- 🔄 Content export functionality
- 🔄 Advanced analytics dashboard
- 🔄 Mobile browser support
- 🔄 Premium features
- 🔄 Machine learning content classification
- 🔄 Real-time collaborative enhancement
- 🔄 Advanced customization options
- 🔄 API for third-party integrations
NovelSynth is released under the Apache License 2.0.
- Google Gemini AI for powerful content processing
- Open source community for tools and libraries
- Beta testers and early adopters
- Contributors and maintainers
Last Updated: $(date) Wiki Version: 1.0.0