Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Ginkooo/browsercookie-rs

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browsercookie-rs

A rust crate useful for extracting cookies from browsers. Inspired from browsercookie python library.

Library

Usage

Using the library is quite simple

// Cargo.toml
[dependencies]
browsercookie-rs = { git="https://github.com/Ginkooo/browsercookie-rs.git", branch="main" }
use browsercookie::{CookieFinder, Browser, Attribute};
use regex::Regex;

let mut cookie_jar = CookieFinder::builder()
    .with_regexp(Regex::new("google.com").unwrap(), Attribute::Domain)
    .with_browser(Browser::Firefox)
    .build()
    .find()
    .await;

let cookie = cookie_jar.get("some_cookie_name").unwrap();

println!("Cookie header string: Cookie: {}", cookie);

You can omit the .with_ calls to get all cookies from all browsers.

A better example should be present in browsercookies.

Binary

The same crate should also give you a binary browsercookies, which should be usable from your favorite shell for crudely using frontend APIs for simple tooling.

browsercookies --domain jira

Install

cargo install -f browsercookie-rs

Feature Matrix

TargetOS Firefox Chrome
Linux
macOS
Windows

Contributions

Contributions are very welcome. The easiest way to contribute is to look at the Python library browser_cookie3, try to mimic the behavior that this library lacks, and submit a pull request. Make sure to format it, use Clippy, and include some tests.

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.