Overview
The Olis Chrome Extension provides seamless browser integration, allowing users to access Olis features directly from their browser while browsing the web.Technology Stack
Manifest V3
Latest Chrome extension API
TypeScript
Type-safe extension development
Webpack
Module bundling and optimization
React
UI components for popup and options
Project Structure
Development Setup
Build the extension
dist/ directory.For development with hot reload:Features
Context Menu Integration
Right-click on selected text to:- Ask Olis about the selection
- Search with Olis
- Add to knowledge base
- Summarize content
Page Content Extraction
Automatically extract relevant content from web pages:- Article text
- Page metadata
- Links and references
- Code snippets
Quick Access Popup
Search
Quick search interface accessible via browser action
Chat
Mini chat window for quick questions
History
Recent queries and results
Settings
Extension configuration
Manifest Configuration
Communication Architecture
Message Passing
Storage Management
Use Chrome’s storage API for persistence:Building for Production
Test the build
- Load the extension from
dist/directory - Test all features thoroughly
- Check console for errors
- Verify on different websites
Publishing to Chrome Web Store
Register as a developer
Visit Chrome Web Store Developer Dashboard and pay the $5 registration fee.
Upload your extension
- Click “New Item”
- Upload the ZIP file
- Fill in store listing details
- Add screenshots and promotional images
Best Practices
Performance
- Minimize content script impact
- Use event-driven architecture
- Lazy load resources
- Cache API responses
Security
- Validate all input
- Use HTTPS for API calls
- Follow CSP guidelines
- Handle sensitive data carefully
UX
- Fast, responsive UI
- Clear error messages
- Intuitive interactions
- Keyboard shortcuts
Compatibility
- Test on multiple websites
- Handle edge cases
- Graceful degradation
- Cross-browser support
Troubleshooting
Extension Not Loading
Extension Not Loading
Problem: Extension doesn’t appear in ChromeSolution:
- Check manifest.json for errors
- Verify all files referenced exist
- Look for errors in chrome://extensions/
- Reload the extension
Content Script Not Injecting
Content Script Not Injecting
Problem: Content script doesn’t run on pagesSolution:
API Calls Failing
API Calls Failing
Problem: Cannot reach API serverSolution:
- Check host_permissions in manifest:
- Verify CORS is configured on server
- Check network tab in DevTools
- Test API endpoint directly
Build Errors
Build Errors
Problem: Webpack build failsSolution: