browser

package
v0.0.0-...-2198c2c Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package browser provides automatic cookie extraction from browsers.

Package browser provides unified cookie extraction from all supported browsers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromAllBrowsers

func ExtractFromAllBrowsers() (*core.AuthCredentials, string, error)

ExtractFromAllBrowsers tries all available browsers and returns the first valid credentials

func ExtractFromAllBrowsersVerbose

func ExtractFromAllBrowsersVerbose(verbose bool) (*core.AuthCredentials, string, error)

ExtractFromAllBrowsersVerbose tries all browsers with verbose output

func ExtractFromBrowser

func ExtractFromBrowser(browserName string) (*core.AuthCredentials, error)

ExtractFromBrowser extracts cookies from a specific browser

func ExtractFromBrowserVerbose

func ExtractFromBrowserVerbose(browserName string, verbose bool) (*core.AuthCredentials, error)

ExtractFromBrowserVerbose extracts cookies with verbose output

func GetDefaultChromePaths

func GetDefaultChromePaths() []string

GetDefaultChromePaths returns default Chrome cookie paths by OS

func GetDefaultFirefoxPaths

func GetDefaultFirefoxPaths() []string

GetDefaultFirefoxPaths returns default Firefox cookie paths by OS

func IsChromeAvailableWindows

func IsChromeAvailableWindows() bool

IsChromeAvailableWindows checks if Chrome is available on Windows This is a stub for non-Windows platforms.

func IsFirefoxAvailable

func IsFirefoxAvailable() bool

IsFirefoxAvailable checks if Firefox cookies are available

func IsFirefoxAvailableWindows

func IsFirefoxAvailableWindows() bool

IsFirefoxAvailableWindows checks Firefox on Windows

func ListAvailableBrowsers

func ListAvailableBrowsers() []string

ListAvailableBrowsers returns a list of available browsers on the system

func ListAvailableChromeBrowsers

func ListAvailableChromeBrowsers() []string

ListAvailableChromeBrowsers returns a list of available Chrome-based browsers

Types

type ChromeCookie

type ChromeCookie struct {
	HostKey        string `json:"host_key"`
	Name           string `json:"name"`
	Value          string `json:"value"`
	EncryptedValue []byte `json:"encrypted_value"`
	Path           string `json:"path"`
}

ChromeCookie represents a cookie from Chrome's cookie database

type ChromeCookieExtractor

type ChromeCookieExtractor struct {
	Name string
	Path string
}

ChromeCookieExtractor extracts cookies from Chrome-based browsers

func (*ChromeCookieExtractor) ExtractCookies

func (c *ChromeCookieExtractor) ExtractCookies() (*core.AuthCredentials, error)

ExtractCookies extracts Twitter/X cookies from Chrome

func (*ChromeCookieExtractor) ExtractCookiesVerbose

func (c *ChromeCookieExtractor) ExtractCookiesVerbose(verbose bool) (*core.AuthCredentials, error)

ExtractCookiesVerbose extracts cookies with optional verbose output

type ExtractionResult

type ExtractionResult struct {
	Browser string
	Creds   *core.AuthCredentials
	Error   error
}

ExtractionResult represents the result of a browser extraction attempt

type Extractor

type Extractor interface {
	ExtractCookies() (*core.AuthCredentials, error)
	Name() string
	IsAvailable() bool
}

Extractor is the unified interface for browser cookie extraction

type FirefoxCookie

type FirefoxCookie struct {
	Host  string `json:"host"`
	Name  string `json:"name"`
	Value string `json:"value"`
	Path  string `json:"path"`
}

FirefoxCookie represents a Firefox cookie

type FirefoxCookieExtractor

type FirefoxCookieExtractor struct {
	Path string
}

FirefoxCookieExtractor extracts cookies from Firefox

func (*FirefoxCookieExtractor) ExtractCookies

func (f *FirefoxCookieExtractor) ExtractCookies() (*core.AuthCredentials, error)

ExtractCookies extracts Twitter/X cookies from Firefox

Jump to

Keyboard shortcuts

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