Documentation
¶
Overview ¶
Package browser provides automatic cookie extraction from browsers.
Package browser provides unified cookie extraction from all supported browsers
Index ¶
- func ExtractFromAllBrowsers() (*core.AuthCredentials, string, error)
- func ExtractFromAllBrowsersVerbose(verbose bool) (*core.AuthCredentials, string, error)
- func ExtractFromBrowser(browserName string) (*core.AuthCredentials, error)
- func ExtractFromBrowserVerbose(browserName string, verbose bool) (*core.AuthCredentials, error)
- func GetDefaultChromePaths() []string
- func GetDefaultFirefoxPaths() []string
- func IsChromeAvailableWindows() bool
- func IsFirefoxAvailable() bool
- func IsFirefoxAvailableWindows() bool
- func ListAvailableBrowsers() []string
- func ListAvailableChromeBrowsers() []string
- type ChromeCookie
- type ChromeCookieExtractor
- type ExtractionResult
- type Extractor
- type FirefoxCookie
- type FirefoxCookieExtractor
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 ¶
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