Skip to content

[CHORE] support chrome 142 and fix windows build#27

Merged
arman-bd merged 9 commits intodevelopfrom
feature/chrome-profile-142-and-ja4
Nov 7, 2025
Merged

[CHORE] support chrome 142 and fix windows build#27
arman-bd merged 9 commits intodevelopfrom
feature/chrome-profile-142-and-ja4

Conversation

@arman-bd
Copy link
Owner

@arman-bd arman-bd commented Nov 7, 2025

No description provided.

arman-bd and others added 3 commits November 7, 2025 00:19
  - Enable certificate compression (Brotli, Zlib) for Cloudflare compatibility
  - Implement perfect JA3N, JA4, and JA4_R fingerprint matching
  - Add chrome/chrome142 browser profile aliases
  - Include comprehensive Chrome 142 fingerprint tests
  - Update README with Chrome 142 features and legal disclaimer
  - Re-enable MLKEM768 post-quantum cryptography support
@arman-bd arman-bd self-assigned this Nov 7, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

arman-bd and others added 6 commits November 7, 2025 02:24
Ninja generator requires MSVC compiler (cl) to be in PATH, but in CI
environments without Visual Studio Developer Command Prompt active,
cl is not available. This caused cmake configuration to fail.

Fix: Check for both ninja AND cl before using Ninja generator.
Falls back to Visual Studio generator which automatically sets up
MSVC environment.

This maintains parallel compilation benefits via --parallel flag
while ensuring builds work in all CI environments.
Add support for OS-specific user agents across all browser profiles.
Users can now specify the operating system to simulate different platforms.

Changes:
- Add os_type_t enum (OS_MACOS, OS_WINDOWS, OS_LINUX) in browser_profiles.h
- Add user_agent_windows and user_agent_linux fields to browser_profile_t
- Add browser_profile_get_user_agent() helper function
- Update PROFILE_CHROME_142 with OS-specific user agents:
  * macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...
  * Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
  * Linux: Mozilla/5.0 (X11; Linux x86_64) ...
- Add 'os' parameter to Session class (default: 'macos')
- Update Python client to pass OS parameter through to C extension

Usage:
  session = httpmorph.Session(browser='chrome', os='windows')
  session = httpmorph.Session(browser='chrome', os='linux')
  session = httpmorph.Session(browser='chrome')  # defaults to macOS

Supported OS values: 'macos' (default), 'windows', 'linux'
Add 3 test cases to verify OS-specific user agents using httpbin /user-agent:
- test_os_macos_user_agent: Verifies macOS user agent string
- test_os_windows_user_agent: Verifies Windows user agent string
- test_os_linux_user_agent: Verifies Linux user agent string

Each test:
- Creates session with specific OS parameter
- Makes request to httpbin /user-agent endpoint
- Validates correct OS-specific user agent is sent

All tests pass successfully.
  - Add os parameter to Session (macos, windows, linux)
  - Update README.md and readthedocs with OS feature
  - Remove obsolete browser profiles (firefox, safari, edge)
  - Add accurate Chrome 142 fingerprint documentation
  - Update API reference with correct parameters
@arman-bd arman-bd merged commit 30776a0 into develop Nov 7, 2025
13 checks passed
arman-bd added a commit that referenced this pull request Nov 7, 2025
* [CHORE] support chrome 142 and fix windows build (#27)

* feat: Add Chrome 142 fingerprint support with certificate compression

  - Enable certificate compression (Brotli, Zlib) for Cloudflare compatibility
  - Implement perfect JA3N, JA4, and JA4_R fingerprint matching
  - Add chrome/chrome142 browser profile aliases
  - Include comprehensive Chrome 142 fingerprint tests
  - Update README with Chrome 142 features and legal disclaimer
  - Re-enable MLKEM768 post-quantum cryptography support

* chore: ignore Cython-generated .cpp files

* perf(windows): add parallel compilation and cache detection to vendor builds

* fix(windows): detect MSVC environment before using Ninja generator

Ninja generator requires MSVC compiler (cl) to be in PATH, but in CI
environments without Visual Studio Developer Command Prompt active,
cl is not available. This caused cmake configuration to fail.

Fix: Check for both ninja AND cl before using Ninja generator.
Falls back to Visual Studio generator which automatically sets up
MSVC environment.

This maintains parallel compilation benefits via --parallel flag
while ensuring builds work in all CI environments.

* feat: add OS-specific user agent support (macOS, Windows, Linux)

Add support for OS-specific user agents across all browser profiles.
Users can now specify the operating system to simulate different platforms.

Changes:
- Add os_type_t enum (OS_MACOS, OS_WINDOWS, OS_LINUX) in browser_profiles.h
- Add user_agent_windows and user_agent_linux fields to browser_profile_t
- Add browser_profile_get_user_agent() helper function
- Update PROFILE_CHROME_142 with OS-specific user agents:
  * macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...
  * Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
  * Linux: Mozilla/5.0 (X11; Linux x86_64) ...
- Add 'os' parameter to Session class (default: 'macos')
- Update Python client to pass OS parameter through to C extension

Usage:
  session = httpmorph.Session(browser='chrome', os='windows')
  session = httpmorph.Session(browser='chrome', os='linux')
  session = httpmorph.Session(browser='chrome')  # defaults to macOS

Supported OS values: 'macos' (default), 'windows', 'linux'

* test: add OS-specific user agent tests for macOS, Windows, and Linux

Add 3 test cases to verify OS-specific user agents using httpbin /user-agent:
- test_os_macos_user_agent: Verifies macOS user agent string
- test_os_windows_user_agent: Verifies Windows user agent string
- test_os_linux_user_agent: Verifies Linux user agent string

Each test:
- Creates session with specific OS parameter
- Makes request to httpbin /user-agent endpoint
- Validates correct OS-specific user agent is sent

All tests pass successfully.

* docs: Add OS-specific user agents and clean up documentation

  - Add os parameter to Session (macos, windows, linux)
  - Update README.md and readthedocs with OS feature
  - Remove obsolete browser profiles (firefox, safari, edge)
  - Add accurate Chrome 142 fingerprint documentation
  - Update API reference with correct parameters

* feat: benchmark on windows

* feat: benchmark on mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants