Thank you for your interest in contributing to HAR Cleaner! This document provides guidelines for contributing to the project.
If you find a bug, please open an issue with:
- Clear title - Describe the issue briefly
- Steps to reproduce - Detailed steps to recreate the bug
- Expected behavior - What should happen
- Actual behavior - What actually happens
- Environment - OS, Python version, browser
- Screenshots - If applicable
Feature requests are welcome! Please include:
- Use case - Why is this feature needed?
- Description - What should it do?
- Examples - How would users interact with it?
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit with clear messages
- Push to your fork
- Open a Pull Request
- Python 3.7+
- Basic knowledge of Flask and JavaScript
git clone https://github.com/timtai1/HAR-Cleaner.git
cd HAR-Cleaner
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt# Enable debug mode in app.py (already enabled by default in app.py)
python app.pyThis enables:
- Auto-reload on code changes
- Detailed error messages
- Debug toolbar
HAR_cleaner/
├── app.py # Flask backend
├── har_cleaner.py # CLI version
├── run.py # Production launcher
├── templates/
│ └── index.html # Main UI
└── static/
├── css/
│ └── style.css # Custom styles
└── js/
└── app.js # Frontend logic
- Follow PEP 8
- Use type hints where applicable
- Add docstrings to functions
- Keep functions focused and small
Example:
def get_fqdn(url: str) -> str:
"""
Extracts the hostname (FQDN) from a given URL.
Args:
url: The URL to parse
Returns:
The hostname/FQDN, or empty string if invalid
"""
try:
return urlparse(url).hostname or ""
except Exception:
return ""- Use modern ES6+ syntax
- Use
constandlet, avoidvar - Add JSDoc comments for functions
- Keep functions pure where possible
Example:
/**
* Filters URLs based on search text
*/
function filterURLs() {
const searchText = document.getElementById('urlSearch').value.toLowerCase();
// ...
}- Use semantic HTML5 tags
- Follow Bootstrap conventions
- Keep custom CSS minimal
- Ensure responsive design
Before submitting a PR, test:
- File upload (drag & drop and browse)
- Domain selection (select/deselect all)
- URL filtering and search
- Pagination (50/100/200/All)
- Size checking
- Export functionality
- Error handling (invalid files, oversized files)
- Browser compatibility (Chrome, Firefox, Safari, Edge)
- Mobile responsiveness
Create test HAR files with:
- Small files (< 1MB)
- Medium files (1-20MB)
- Large files (> 20MB)
- Multiple domains
- Single domain
- Invalid JSON
-
Never store HAR files permanently
- Use temporary storage only
- Clean up after sessions expire
-
No external API calls
- All processing must be local
- No data should leave the user's machine
-
Input validation
- Validate file types
- Sanitize user input
- Limit file sizes
-
XSS Prevention
- Escape all user-provided content
- Use CSP headers
- Validate URLs before display
When adding features, update:
- README.md - Main documentation
- FEATURES.md - Feature list and use cases
- QUICK_START.md - If it affects quick start
- Code comments - Inline documentation
Use clear, descriptive commit messages:
Good:
Add URL search functionality to Step 3
Fix pagination bug when showing all URLs
Update README with Windows installation steps
Bad:
Update
Fix bug
Changes
Feel free to:
- Open an issue with the "question" label
- Reach out to maintainers
- Join discussions in existing issues
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to HAR Cleaner!