ffcookies

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: MIT Imports: 12 Imported by: 0

README

ffcookies

Package ffcookies provides a quick way to decode Firefox browser cookies for use with Go's standard HTTP libraries.

Example

See _example/example.go for an example.

Documentation

Overview

Package ffookies provides a quick way to read cookies from a firefox browser profile.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOpenParams = "?nolock=1&immutable=1&mode=ro"

DefaultOpenParams are the default open parameters to use.

Functions

func Jar

func Jar(u *url.URL, cookies ...*http.Cookie) (http.CookieJar, error)

Jar builds a cookie jar for the url from provided cookies.

func Read

func Read(profile, host string) ([]*http.Cookie, error)

Read reads the cookies for the provided Firefox profile name.

func ReadContext

func ReadContext(ctx context.Context, profile, host string) ([]*http.Cookie, error)

ReadContext reads the cookies for the provided Firefox profile name, or the default Firefox profile.

func ReadFile

func ReadFile(file, host string) ([]*http.Cookie, error)

ReadFile reads the cookies from the provided sqlite3 file on disk.

func ReadFileContext

func ReadFileContext(ctx context.Context, file, host string) ([]*http.Cookie, error)

ReadFileContext reads the cookies from the provided sqlite3 file on disk.

func ReadJar

func ReadJar(profile, urlstr string) (http.CookieJar, error)

ReadJar reads the cookies from the provided sqlite3 file for the provided url into a cookie jar usable with http.Client.

func ReadJarContext

func ReadJarContext(ctx context.Context, profile, urlstr string) (http.CookieJar, error)

ReadJarContext reads the cookies from the provided sqlite3 file for the provided url into a cookie jar usable with http.Client.

func ReadJarFiltered

func ReadJarFiltered(profile, urlstr string, f func(*http.Cookie) bool) (http.CookieJar, error)

ReadJarFiltered reads the cookies from the provided sqlite3 file for the provided url into a cookie jar (usable with http.Client) consisting of cookies passed through filter func f.

func ReadJarFilteredContext

func ReadJarFilteredContext(ctx context.Context, profile, urlstr string, f func(*http.Cookie) bool) (http.CookieJar, error)

ReadJarFilteredContext reads the cookies from the provided sqlite3 file for the provided url into a cookie jar (usable with http.Client) consisting of cookies passed through filter func f.

Types

This section is empty.

Directories

Path Synopsis
_example/example.go
_example/example.go
Package models contains generated code for schema 'cookies.sqlite'.
Package models contains generated code for schema 'cookies.sqlite'.

Jump to

Keyboard shortcuts

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