Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 49 additions & 56 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,75 +5,68 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2024-12-XX
## [Unreleased]

### Added
- **I/O Mode**: New `cdp.connection` module providing WebSocket I/O, JSON-RPC framing, and command multiplexing
- **8 New Domains**: Extensions, FedCm, DeviceAccess, FileSystem, Autofill, BluetoothEmulation, PWA, Preload
- **Privacy Sandbox APIs**: Comprehensive support for Attribution Reporting, Shared Storage, Interest Groups/FLEDGE
- Security-focused APIs for testing federated authentication, device permissions, and extension boundaries
- Bounce tracking mitigation testing capabilities
- IP protection proxy status and control
- Related Website Sets (First-Party Sets) support
- Form security issue detection via Audits domain
- Privacy Sandbox enrollment override for testing
- Enhanced cookie controls for third-party cookie testing
- CONTRIBUTING.md with contribution guidelines
- CHANGELOG.md for tracking version history
- CODE_OF_CONDUCT.md for community standards
- SECURITY.md with security policy and vulnerability reporting

## [0.5.0]

### Added
- I/O Mode with built-in WebSocket connection support via `cdp.connection` module
- WebSocket management with async context managers
- JSON-RPC message framing and multiplexing
- Event handling via async iterators
- Comprehensive error handling with typed exceptions
- Optional websockets dependency via `[io]` extra

### Changed
- Updated to Chrome DevTools Protocol version 1.3 (latest)
- Fixed same-domain type reference bug in code generator (e.g., `Network.TimeSinceEpoch` now correctly resolves)
- Improved code generator to protect manually-written files (connection.py, util.py)
- `page.navigate()` now returns 4 values instead of 3 (added `is_download` parameter)
- Enhanced README with I/O mode documentation
- Improved examples demonstrating both Sans-I/O and I/O modes

### Removed
- **Breaking Change**: Removed deprecated Database domain (use IndexedDB, Storage, or Cache Storage APIs instead)
## [0.4.0]

### Security
- Added comprehensive security testing capabilities for Privacy Sandbox
- Enhanced storage domain with privacy-preserving measurement APIs
- Added attribution reporting and shared storage tracking
- Improved form security auditing
### Changed
- Updated to latest Chrome DevTools Protocol specification
- Improved type hints and mypy compliance
- Enhanced documentation

## [0.4.0] - Previous Release
## [0.3.0]

### Added
- Initial sans-I/O implementation
- Type wrappers for Chrome DevTools Protocol
- Initial Sans-I/O implementation
- Automatic code generation from CDP specification
- Support for Python 3.7+

## Migration Guide

### From 0.4.x to 0.5.0
- Type wrappers for all CDP types, commands, and events
- Comprehensive test suite

#### Database Domain Removed
```python
# Old (no longer works)
from cdp import database
await conn.execute(database.some_command())

# New - Use IndexedDB instead
from cdp import indexed_db
await conn.execute(indexed_db.request_database_names(security_origin="https://example.com"))
```

#### page.navigate() Return Signature Changed
```python
# Old (3 values)
frame_id, loader_id, error_text = await conn.execute(page.navigate(url="..."))
### Changed
- Improved project structure
- Enhanced type safety

# New (4 values - added is_download)
frame_id, loader_id, error_text, is_download = await conn.execute(page.navigate(url="..."))
```
## [0.2.0]

## Links
### Added
- Enhanced type definitions
- Additional protocol domains

- [Repository](https://github.com/HyperionGray/python-chrome-devtools-protocol)
- [Documentation](https://py-cdp.readthedocs.io)
- [PyPI](https://pypi.org/project/chrome-devtools-protocol/)
- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/)
### Fixed
- Various type annotation improvements
- Bug fixes in code generation

---
## [0.1.0]

For detailed security-relevant updates, see [SECURITY.md](SECURITY.md).
For implementation details, see [IMPLEMENTATION.md](IMPLEMENTATION.md).
### Added
- Initial release
- Basic type wrappers for Chrome DevTools Protocol
- Code generator from CDP specification
- MIT License

[Unreleased]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/releases/tag/v0.1.0
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at the project
repository. All complaints will be reviewed and investigated promptly and fairly.
reported to the community leaders responsible for enforcement via GitHub issues.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down
139 changes: 67 additions & 72 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,143 +1,138 @@
# Contributing to PyCDP

Thank you for your interest in contributing to Python Chrome DevTools Protocol (PyCDP)! This document provides guidelines for contributing to the project.
Thank you for your interest in contributing to Python Chrome DevTools Protocol (PyCDP)! We welcome contributions from the community.

## Getting Started

### Prerequisites

- Python 3.7 or higher
- [Poetry](https://python-poetry.org/) for dependency management
- Poetry for dependency management
- Git for version control

### Setting Up Your Development Environment
### Setting Up Development Environment

1. Fork the repository on GitHub
2. Clone your fork locally:
1. Fork and clone the repository:
```bash
git clone https://github.com/YOUR_USERNAME/python-chrome-devtools-protocol.git
cd python-chrome-devtools-protocol
```
3. Install dependencies:

2. Install dependencies:
```bash
pip install poetry
poetry install
```

## Development Workflow

### Code Generation

This project automatically generates Python wrappers from the Chrome DevTools Protocol specification. Most code in the `cdp/` directory (except `connection.py` and `util.py`) is auto-generated.
This project automatically generates Python wrappers from the Chrome DevTools Protocol specification:

To regenerate the protocol wrappers:
```bash
poetry run make generate
poetry run python generator/generate.py
```

### Running Tests

Run the test suite:
```bash
poetry run make test-cdp
poetry run make test-generate
```

Or run all checks:
```bash
poetry run make
poetry run pytest test/
poetry run pytest generator/
```

### Type Checking

We use mypy for static type checking:
```bash
poetry run make mypy-cdp
poetry run make mypy-generate
poetry run mypy cdp/
poetry run mypy generator/
```

### Building Documentation
### Complete Build

To build the documentation:
Run all checks (type checking, tests, and generation):
```bash
poetry run make docs
poetry run make default
```

## Making Changes

### Code Style
## Submitting Changes

- Follow PEP 8 style guidelines
- Use type hints for all function signatures
- Keep code clear and well-documented

### Commit Messages

- Use clear and descriptive commit messages
- Reference issue numbers when applicable
- Keep commits focused on a single change
### Pull Request Process

### Pull Requests

1. Create a new branch for your changes:
1. Create a new branch for your feature or bugfix:
```bash
git checkout -b feature/your-feature-name
```
2. Make your changes and commit them
3. Push to your fork and submit a pull request
4. Ensure all tests pass and type checking succeeds
5. Provide a clear description of your changes

## What to Contribute

### Areas for Contribution
2. Make your changes and ensure:
- All tests pass
- Code passes type checking
- Code follows the existing style
- Documentation is updated if needed

- **Bug fixes**: Fix issues in the connection module or utility functions
- **Documentation**: Improve examples, tutorials, or API documentation
- **Tests**: Add test coverage for existing functionality
- **Examples**: Add new usage examples in the `examples/` directory
3. Commit your changes with clear, descriptive messages:
```bash
git commit -m "Add feature: brief description"
```

### Code Generation Changes
4. Push to your fork and submit a pull request:
```bash
git push origin feature/your-feature-name
```

If you need to modify code generation:
- Edit files in the `generator/` directory
- Run the generator and verify the output
- Ensure all tests still pass
- Add tests for your generator changes
5. In your pull request description:
- Describe what changes you made and why
- Reference any related issues
- Include any relevant context

### Protocol Updates
### Code Review

The protocol definitions are automatically fetched from the Chrome DevTools Protocol repository. If you need to update to a newer protocol version, please open an issue first to discuss the change.
- Maintainers will review your pull request
- Address any feedback or requested changes
- Once approved, a maintainer will merge your PR

## Reporting Issues

### Bug Reports

When reporting bugs, please include:
- Python version
- PyCDP version
- Steps to reproduce
- Expected vs. actual behavior
- Error messages or stack traces
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior vs. actual behavior
- Python version and environment details
- Any relevant error messages or logs

### Feature Requests

For feature requests:
- Clearly describe the feature
- Explain the use case
- Consider if it fits the project's scope
For feature requests, please:
- Clearly describe the feature and its use case
- Explain why it would be valuable
- Provide examples if possible

## Code of Conduct
## Code Style

Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inclusive environment for all contributors.
- Follow PEP 8 style guidelines
- Use type hints for function parameters and return values
- Write clear, descriptive variable and function names
- Add docstrings for public APIs
- Keep functions focused and modular

## Questions?
## Documentation

If you have questions about contributing, please:
- Check existing issues and pull requests
- Open a new issue with your question
- Tag it appropriately for visibility
- Update README.md if you add new features
- Update docstrings for any modified functions or classes
- Add examples for new functionality when appropriate

## License

By contributing to PyCDP, you agree that your contributions will be licensed under the MIT License.
By contributing, you agree that your contributions will be licensed under the MIT License.

## Questions?

If you have questions, feel free to:
- Open an issue for discussion
- Reach out to the maintainers

Thank you for contributing to PyCDP!
Loading
Loading