Commit Graph
31 Commits
Author SHA1 Message Date
Jake WriterandClaude Opus 5.5 e425dddcfd chore(python): remove dead helpers and a stale dependency
None of these had a caller:
- pkgman: is_supported_path, extract_zip, cleanup and set_version, left over
  from the single-directory install. cleanup() would have deleted every
  installed browser version.
- multiversion.get_cached_repo_names, CONSTRAINTS.as_range,
  fingerprints._load_os_voices, utils._clean_locals, and unused imports.

Also:
- The "Apify Fingerprints" row in `camoufox version`, which has read "?"
  since fpgen replaced BrowserForge.
- lxml is no longer a dependency; nothing imports it.
- The geoip extra now names maxminddb, the module geolocation.py actually
  imports, rather than getting it transitively through geoip2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 15:20:45 -06:00
luandhgt b2d842177a Verify sha256 of downloaded release assets before extracting
check_asset() already reads the asset's digest from the GitHub API and
stores it as installed_sha256, and AvailableVersion carries a sha256
field through to version.json. Nothing compared either against the
bytes that were downloaded: every sha256 equality check in the package
compares metadata to metadata when selecting an installed version, and
hashlib appeared only in utils.py to key a config cache.

So the archive that gets extracted over the install directory, and then
chmod 755'd and executed, was accepted on transport security alone. The
digest needed to catch a substituted or truncated asset was already in
hand and unused.

Add verify_sha256() and call it between download and extraction on both
install paths -- install_versioned() for the CLI and InstallWorker for
the GUI. It hashes in 1 MiB blocks so a multi-hundred-megabyte asset
does not have to be held in memory, and rewinds the buffer afterwards
so unzip() still reads from the start.

When no digest is published the install proceeds with a warning rather
than failing: some sources publish no digest, and refusing to install
from them would be a regression, not a fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 65cda21b4f)
2026-09-05 14:26:37 -06:00
Jake WriterandClaude Opus 5 b1fe7227fa fix(python): key the browser floor on Playwright instead of a flat minimum
The incompatibility is two-dimensional -- it needs both a Playwright >= 1.61
and a browser < beta.30 -- but MIN_VERSION only knows about the browser. To
stay safe a flat floor has to assume the worst Playwright, which means:

  * every 0.5.6 user re-downloads the browser, including the majority on
    <1.61 who are in no danger;
  * installs pinned to an older build lose the pin, and prerelease/alpha users
    are moved off their channel, since every alpha sorts below beta.30;
  * the library cannot run at all until the matching browser release is
    published, making the PyPI-after-release ordering load-bearing.

Key it on the resolved Playwright instead. Measured: 1.60 works on beta.29 and
beta.30; 1.61 and 1.62 fail on beta.29 and pass on beta.30.

  playwright <1.61  -> floor alpha.1  -> every install kept
  playwright >=1.61 -> floor beta.30  -> below-beta.30 installs upgraded
  version unreadable -> floor alpha.1 -> kept; a spurious forced re-download is
                                        worse than leaving a working install

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 15:08:26 -06:00
Jake WriterandClaude Opus 5 ce87cf7dab fix(python): report an unsatisfiable version floor instead of recursing
camoufox_path() ended in `return camoufox_path()` after a fetch. When the
newest published build is still below CONSTRAINTS.MIN_VERSION, install() is a
no-op ("already installed") and that tail recursed ~1000 times -- each
iteration firing another GitHub API call, which exhausts the unauthenticated
rate limit (60/hr) long before the RecursionError lands.

That is precisely the state a library published ahead of its browser release
puts every user in, and it is reachable now that the floor is raised. It also
hits permanently for anyone using a repos.yml source that does not carry the
required build.

Re-check after the fetch instead, and raise UnsupportedVersion naming the
required minimum.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 15:06:48 -06:00
Jake WriterandClaude Opus 5 da67775257 fix(python): reach the fetch path when the installed build is below the floor
Raising CONSTRAINTS.MIN_VERSION is how this library has always forced a browser
upgrade (beta.12 -> beta.15 -> beta.17 -> beta.18 -> beta.19); the floor only
became 'alpha.1' incidentally, in an unrelated PR. That left the branch dead,
and it had rotted: camoufox_path() probed INSTALL_DIR/version.json, which only
the pre-multiversion flat layout ever wrote. With a versioned install below the
floor it raised FileNotFoundError instead of falling through to a fetch, so
raising the floor would have crashed every existing user rather than upgrading
them.

Treat a missing root version.json as "no legacy install here" so the caller
falls through to CamoufoxFetcher().install() as intended.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 15:06:48 -06:00
Cloudymap1e a8ad6285d6 fix(linux): prepare required runtime directory 2026-07-28 00:26:37 -06:00
daijro 3911d11dbd Support for releases with the same version and build v0.5.2
Fix for JWriter20 repo having several releases with the same version and build name, which broke the manager
- Installs browsers as version-build-sha256/ rather than version-build/ since assets can share a version-build combo
- Doesn't break existing downloads
- Show date column in gui and selector tui
2026-06-23 07:24:40 -05:00
daijro 53e10d3d3b Make alpha versions available through the Camoufox manager
Adds "alpha" releases to the official/prerelease channel, even if the asset isnt marked as a prerelease
2026-06-08 05:19:06 -05:00
daijro be0951543b Update help msg, icon, & bugfix
- Don't fall back to old browsers if the active one isnt installed
- Remade the icon for the gui
- Better exception info
2026-03-07 02:21:15 -06:00
daijro ce3b93b958 Clean READMEs, clean old data dir on fetch, & more
- Removes the old data directory if Camoufox was installed before 0.5.0
- Fix messy sponsors segment & add repo status info at the top of the README
- Add camoufox/camoufox org as fallback
- Remove (experimental) next to the GeoIP by daijro source
- Format
2026-03-06 07:38:43 -06:00
daijro ac9ee1531a Clean up manager UI & add more info in version cli
- Rewrite `camoufox version` to show storage/path info and more python packages
- In camoufox active/set, show active channels. Fall back to original/stable if none is set
- Remove config files in `camoufox remove --all`
- Spoof the camoufox python library version in UI debug mode
- Fix scrollbar always showing on windows
- Other UI cleanup
2026-02-07 23:16:16 -06:00
daijro 0923b12194 Exception handling 2026-02-07 03:29:35 -06:00
daijro b4d5ae515f Merge branch 'daijro-fixes' into daijro-camoufox-manager 2026-02-07 03:04:31 -06:00
daijro e0e2eeb2f3 Add version manager in python library 2026-02-07 02:47:01 -06:00
Pierre 6e6f6736fb Use GITHUB_TOKEN if it exists to download Camoufox 2025-07-10 15:01:19 +02:00
daijro e3d3dcd6e7 pythonlib: Look for assets in earlier releases #134 0.4.9 2024-12-13 01:01:20 -06:00
daijro 4c52518dd2 pythonlib: Cleanup & bump to 0.4.6
- `camoufox test` will no longer highlight the cursor by default
- Fixed launch_options blocking async
- WebGL database cleanup & added ability to query all possible vendor/renderer pairs
2024-12-04 19:35:54 -06:00
daijro 3a33283cd2 pythonlib: Add enable_cache, fixed font spacing, etc 0.3.9
- Enable bf cache with `enable_cache=True` #74
- Font spacing is now fixed per session #63
- Re-download (or raise error) when target install path is empty. Caused when the user cancels the download.
- Bumped minimum version to beta.15
2024-11-11 22:11:43 -06:00
daijro ca7c3e3aa8 No progress bar on addon download #65
- Removed progress bars on addon download (shows as percent instead)
- Default addons are downloaded on `camoufox fetch`
2024-11-03 04:01:17 -06:00
daijro 33189cd5b4 pythonlib: Fully fix #61 0.3.6 2024-10-31 06:42:47 -05:00
Karim shoair 473d04ce13 Complete fix for #61
https://github.com/daijro/camoufox/issues/61
2024-10-31 14:13:13 +03:00
daijro 692e8a162c pythonlib: Support Python 3.8 #61 0.3.5 2024-10-31 05:09:17 -05:00
daijro 0ff90fc750 Version range control, multi locale usage, etc
- Python library now constrains the supported Camoufox version, and will force an update if you are out of date.
- Added support patch for multiple accepted languages #37
- Added pysocks #43
- Added README deprecation notices
- Added public launch_options command
- Bumped python library to 0.3.0
- Full support for beta.12
2024-10-19 23:10:51 -05:00
daijro bd59304481 pythonlib: Add Xvfb integration #26 0.2.9
- Automatically uses virtual displays on Linux
- Update documentation on README
2024-10-08 05:10:12 -05:00
daijro 351e99ed18 pythonlib: Add more leak warnings 0.2.8
Warns the user for when the passed parameters are likely to cause a leak.
2024-10-06 23:32:50 -05:00
daijro 79c436e506 pythonlib: Add remote server launching #7
Uses a hacky work around to run Javascript in Playwright's internal library to gain access to the launchServer method.
2024-10-02 02:45:26 -05:00
daijro 7d825e53d9 pythonlib: Typing & environ var fixes 0.2.1
- Fixes typing with OS_NAME
- Fix exceeding environment variable length on Windows (caused by typing issue)
- Fix not passing fontconfig on Linux (caused by typing issue)
2024-09-29 17:30:11 -05:00
daijro f6396c1e81 pythonlib: Add locale, geolocation/locale from IP, & more 0.2.0
- Added `geoip` parameter to automatically find the target IP's longitude, latitude, timezone, country, language/region locale, & spoof the WebRTC IP address. #5
- Added parameter to set the locale #16
- Automatically calculate the locale based on the distribution of speakers in the target geoip region.
- Added allow_webgl option #17
- By default, use the current version of Camoufox instead of Browserforge's Firefox versions #14.
2024-09-29 17:30:00 -05:00
daijro 3488008311 pythonlib: Release to PyPi, Update README 2024-09-19 04:52:18 -05:00
daijro 581cb5ce3f pythonlib: Fixes & cleanup
- Fix chmod not working
- Add more instructions to README
- Cleanup comments
2024-09-17 12:28:25 -05:00
daijro 5e1fb78cfc Camoufox Python interface
Port of the launcher to a Python library.
2024-09-16 04:01:20 -05:00