BrowseForge icon indicating copy to clipboard operation
BrowseForge copied to clipboard

[Bug]: Camoufox runtime always disabled on Windows x64 despite documented support

Open Cary222 opened this issue 2 months ago • 1 comments

[Bug]: Camoufox runtime always disabled on Windows x64 despite documented support

Summary

On Windows x64, the camoufox runtime is permanently disabled and cannot be used, even though:

  • docs/platform-support.md lists Windows x64 + Camoufox v135 = Supported
  • internal/browser/download.go contains a working Windows download branch
  • The browser binary downloads and installs successfully via browseforge browsers install --runtimes camoufox

POST /api/profiles with runtime_id: "camoufox" always fails with INVALID_RUNTIME.

Environment

BrowseForge v2.1.14 (lite, BrowseForge-v2.1.14-lite-windows-x64.zip)
OS / Arch Windows 11 x64 (amd64)
Deployment Native (not Docker)
Camoufox v135.0.1-beta.24 (installed successfully by BrowseForge itself)

Reproduction Steps

  1. Download and extract BrowseForge-v2.1.14-lite-windows-x64.zip.

  2. Run BrowseForge serve --no-open.

  3. Install the Camoufox runtime:

    HTTPS_PROXY=http://127.0.0.1:7897 BrowseForge browsers install --runtimes camoufox
    

    Result: ✅ Camoufox installed — the binary lands at browsers/camoufox/camoufox.exe and .version reads v135.0.1-beta.24.

  4. Confirm the runtime through the API:

    curl -H "Authorization: Bearer $(cat data/.api-token)" http://127.0.0.1:19280/api/runtimes
    
  5. Attempt to create a profile:

    curl -X POST http://127.0.0.1:19280/api/profiles \
      -H "Authorization: Bearer $(cat data/.api-token)" \
      -H "Content-Type: application/json" \
      -d '{"name":"test","runtime_id":"camoufox"}'
    

Expected Behavior

Step 5 creates a Camoufox profile, and /api/runtimes reports platform_supported: true for camoufox on windows/amd64.

Actual Behavior

/api/runtimes reports:

{
  "id": "camoufox",
  "enabled": false,
  "platform_supported": false,
  "unsupported_reason": "camoufox is not available for windows/amd64"
}

POST /api/profiles returns:

{"error":{"code":"INVALID_RUNTIME","message":"runtime \"camoufox\" is disabled"}}

Setting runtimes.camoufox.enabled = true and a valid binary_path in config.json does not help: the values are silently reset to enabled: false / binary_path: "" on every startup, and the server rewrites config.json accordingly. Setting skip_auto_update: true and BROWSEFORGE_SKIP_BROWSER_AUTO_UPDATE=true does not help either, because the check happens after the platform gate.

Root Cause

internal/runtime/runtime.go → platformSupported() omits the windows branch for Camoufox, while the other two runtimes both include it:

func platformSupported(id ID, goos, goarch string) (bool, string) {
	supported := false
	switch id {
	case Camoufox:
		supported = (goos == "linux" && (goarch == "amd64" || goarch == "arm64")) ||
			(goos == "darwin" && goarch == "arm64")
		// <-- no windows branch
	case CloakBrowser:
		supported = ((goos == "darwin" || goos == "linux") && (goarch == "amd64" || goarch == "arm64")) ||
			(goos == "windows" && goarch == "amd64")
	case BrowseForgeChromium:
		supported = ((goos == "darwin" || goos == "linux") && (goarch == "amd64" || goarch == "arm64")) ||
			(goos == "windows" && goarch == "amd64")
	}
	if supported {
		return true, ""
	}
	return false, fmt.Sprintf("%s is not available for %s/%s", id, goos, goarch)
}

applyPlatformSupport() then force-disables the runtime and blanks the configured path:

func applyPlatformSupport(desc Descriptor) Descriptor {
	desc.PlatformSupported, desc.UnsupportedReason = platformSupported(desc.ID, goruntime.GOOS, goruntime.GOARCH)
	if !desc.PlatformSupported {
		desc.Enabled = false
		desc.BinaryPath = ""
	}
	return desc
}

This contradicts two other places in the same release:

  • internal/browser/download.go → camoufoxDownloadFilenameFor() does handle Windows:

    case "windows":
        if goarch == "amd64" {
            return "camoufox-135.0.1-beta.24-win.x86_64.zip", nil
        }
    
  • docs/platform-support.md states:

    | Windows x64 | Supported | v135 | v146 | Alpha artifact | Native binaries |
    

So the download layer and the docs both treat Windows x64 as supported, while the runtime registry gate rejects it.

Suggested Fix

Add the Windows branch to platformSupported() for Camoufox:

case Camoufox:
    supported = (goos == "linux" && (goarch == "amd64" || goarch == "arm64")) ||
        (goos == "darwin" && goarch == "arm64") ||
        (goos == "windows" && goarch == "amd64")

Notes

  • The error string format also differs from the constructor: UnsupportedRuntimePlatformError.Error() formats as "%s %s is not available for %s/%s" (which would include the display name and version, e.g. Camoufox v135.0.1-beta.24 is not available for windows/amd64), but the API returns the shorter lowercase camoufox is not available for windows/amd64. This made the failure harder to trace back to platformSupported().
  • I have not opened a PR, since I am not sure whether the omission was deliberate (e.g. an untested Windows Camoufox path) or accidental. Happy to send one if the Windows path is intended to be supported.

Cary222 avatar Sep 26 '26 06:09 Cary222

Thank you for the very detailed report. The reproduction steps, API responses, root-cause comparison, and the mismatch you identified between download.go, the docs, and the runtime registry made this quick to verify.

Confirmed: this was a real bug. Camoufox v135.0.1-beta.24 does provide a Windows x64 artifact, but the runtime registry had a separate platform support table that omitted windows/amd64. That caused /api/runtimes and POST /api/profiles to incorrectly report Camoufox as disabled on Windows x64.

This is fixed and released:

  • Fix commit: bd0eb78 Fix Camoufox Windows runtime support
  • Release: https://github.com/nczz/BrowseForge/releases/tag/v2.1.15

The fix does more than add a single Windows branch: the duplicated platform table in the runtime registry was removed. The registry, CLI status/install path, and download layer now share one runtime artifact support source, so docs/download/API support decisions cannot drift in the same way again.

Please try the v2.1.15 Windows x64 lite package when you can:

  1. Run BrowseForge serve --no-open.
  2. Check GET /api/runtimes; camoufox.platform_supported should now be true.
  3. Create a profile with POST /api/profiles and {"name":"test","runtime_id":"camoufox"}.

If you still hit a Windows-specific launch/runtime issue, please add the logs here or open a follow-up issue. The platform gate bug itself is fixed in v2.1.15.

nczz avatar Sep 29 '26 15:09 nczz