Getting Started
Contributions are welcome! Knowledge Tooltip is designed to be simple and accessible. The entire codebase is vanilla JavaScript with no build tools or dependencies.Before contributing, make sure you’ve completed the development setup and understand the project structure.
Code Standards
Vanilla JavaScript Only
This project intentionally avoids frameworks and build tools:- Write plain JavaScript (ES6+)
- No TypeScript, React, Vue, or other frameworks
- No npm, webpack, or bundlers
- No transpilation or compilation
Code Style
Follow these conventions for consistency: JavaScript:- Use
constandlet(avoidvar) - Use arrow functions for callbacks
- Use async/await for promises
- Use template literals for string interpolation
- Add comments for complex logic
- Use semicolons
- Use semantic HTML elements
- Use kebab-case for IDs and classes
- Add ARIA attributes for accessibility
- Use CSS custom properties for theming
- Use meaningful class names
- Support RTL (right-to-left) layouts for Arabic
- Avoid !important
File Organization
Keep the flat file structure:Testing Workflow
Manual Testing
Before submitting a pull request:Test Core Functionality
- Load the extension in Chrome (see setup guide)
- Test text selection on multiple websites
- Test all five tabs: Summary, Define, Facts, AI, Translate
- Test with both English and Arabic content
Test Language Modes
- Open the extension popup
- Test each language setting:
- Auto-detect
- English
- Arabic
- Verify UI language switches correctly
- Verify API calls use the correct language
Test Edge Cases
- Very long text selections (100+ words)
- Single-character selections
- Non-Latin characters (Arabic, Chinese, emoji)
- Terms with no Wikipedia/Wiktionary results
- Network errors (test with DevTools offline mode)
Testing APIs
Free APIs (no key required):- Test Summary with: “Python programming”, “مصر” (Egypt in Arabic)
- Test Define with: “serendipity”, “ephemeral”
- Test Facts with: “Paris”, “Albert Einstein”
- Test AI with follow-up questions
- Test Translate with English and Arabic text
- Verify conversation history works correctly
If you don’t have an OpenAI API key for testing, note that in your pull request. Maintainers will test those features.
Areas for Contribution
Here are specific areas where contributions are especially welcome:1. Language Support
Add support for additional languages beyond English and Arabic. What’s needed:- UI translations in
content.jsandpopup.html - Language detection logic in
content.js - API calls to language-specific Wikipedia/Wiktionary endpoints
- RTL support in
styles.cssif applicable
content.js
2. New Knowledge Tabs
Add new tabs with additional data sources. Ideas:- Synonyms/antonyms tab
- Images/media tab
- Related topics tab
- Etymology tab
- News articles tab
- Use free, public APIs (no authentication preferred)
- Add API domain to
host_permissionsinmanifest.json - Implement fetch function in
background.js - Add tab definition and rendering in
content.js - Add tab icon SVG
3. Improved AI Prompts
Enhance the AI tab prompts for better explanations. Current prompts: Seebackground.js around line 200
Improvements:
- Better context awareness
- More concise explanations
- Age-appropriate explanations (ELI5 mode)
- Domain-specific prompts (science, history, etc.)
4. Accessibility Improvements
What’s needed:- ARIA labels for all interactive elements
- Keyboard navigation support
- Screen reader testing
- High contrast mode support
- Focus indicators
5. UI/UX Enhancements
Ideas:- Tooltip positioning improvements
- Better mobile browser support
- Smooth animations
- Dark mode support
- Customizable themes
6. Performance Optimizations
Areas:- Reduce memory usage
- Optimize cache invalidation
- Lazy load tab content
- Debounce API calls
- Minimize DOM operations
Submitting Changes
Before Submitting
Pull Request Process
PR Template
Use this template for your pull request description:Code Review
Maintainers will review your PR and may:- Request changes
- Ask questions
- Suggest improvements
- Merge your contribution
Privacy and Security
Knowledge Tooltip prioritizes user privacy. When contributing:Always:
- Store API keys in
chrome.storage.localonly - Make API calls through
background.js - Minimize data collection
- Document what data is sent where
- Update
PRIVACY_POLICY.mdif data handling changes
Questions?
If you have questions or need help:- Check the development setup guide
- Review the project structure documentation
- Open a GitHub issue with the
questionlabel - Tag maintainers in your PR if you need guidance
Development Setup
Get your development environment ready
Project Structure
Understand the codebase architecture
Thank you for contributing to Knowledge Tooltip! Your efforts help make knowledge more accessible to everyone.