browserforge

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-browserforge

Go port of BrowserForge, intended to provide realistic browser header and fingerprint generation for Go automation stacks.

This repository is intentionally separate from go-camoufox. BrowserForge is a reusable fingerprint/header generation engine, while go-camoufox is a Camoufox browser launcher/runtime.

Goal

The target is API and behavior parity with Python BrowserForge where practical:

  • headers.Generator for HTTP header generation.
  • fingerprints.Generator for navigator, screen, codecs, WebGL, fonts, and related fingerprint data.
  • Bayesian-network sampling from the same Apify datapoint model used by Python BrowserForge.
  • Go-friendly deterministic tests comparing constraints and generated shapes against the Python reference.

Status

Implemented:

  • Embedded Apify BrowserForge datapoints.
  • Go Bayesian-network sampler compatible with the Python BrowserForge network shape.
  • Header generation with browser, OS, device, locale, HTTP version, user-agent, and request-dependent header constraints.
  • Fingerprint generation with BrowserForge screen constraints and navigator/header consistency.
  • Tests for Firefox header generation, request-dependent headers, fingerprint screen constraints, and invalid constraints.
  • Python reference parity matrix tests for Firefox desktop fingerprints across Windows, Linux, macOS, plus strict impossible screen constraints.

The Go API is idiomatic rather than a line-for-line Python API clone, but the generation model and data source are the same BrowserForge/Apify network files.

Python parity tests run automatically when a local Python BrowserForge reference is available. Set BROWSERFORGE_PYTHON and BROWSERFORGE_PYTHONPATH to point at an explicit reference environment.

Example

package main

import (
	"fmt"

	"github.com/brainplusplus/go-browserforge/fingerprints"
	"github.com/brainplusplus/go-browserforge/headers"
)

func main() {
	fp, err := fingerprints.Generate(fingerprints.Options{
		Screen: &fingerprints.Screen{
			MinWidth:  1280,
			MaxWidth:  1920,
			MinHeight: 720,
			MaxHeight: 1200,
		},
		Headers: headers.Options{
			Browsers:         []headers.Browser{{Name: "firefox", MinVersion: 135}},
			OperatingSystems: []string{"windows"},
			Devices:          []string{"desktop"},
			Locales:          []string{"en-US"},
		},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(fp.Navigator.UserAgent)
	fmt.Println(fp.Screen.Width, fp.Screen.Height)
}

License

Apache License 2.0, matching the upstream BrowserForge and Apify fingerprint datapoints licensing.

Documentation

Overview

Package browserforge provides browser header and fingerprint generation for Go.

Directories

Path Synopsis
Package fingerprints generates browser fingerprint data compatible with BrowserForge.
Package fingerprints generates browser fingerprint data compatible with BrowserForge.
Package headers generates realistic browser HTTP headers.
Package headers generates realistic browser HTTP headers.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL