Skip to content

Commit

Permalink
add macos edge support
Browse files Browse the repository at this point in the history
  • Loading branch information
sueking authored and goakley committed Dec 29, 2023
1 parent 635a327 commit 5c9a493
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bench_scraper"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
authors = ["Glen Oakley <[email protected]>"]
description = "A library for grabbing browser cookies from a filesystem"
Expand Down
6 changes: 5 additions & 1 deletion src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub enum KnownBrowser {
/// [`Microsoft Edge`], the Windows 10/11 default browser.
///
/// [`Microsoft Edge`]: https://www.microsoft.com/edge/
#[cfg(target_os = "windows")]
#[cfg(any(target_os = "macos", target_os = "windows"))]
Edge,
/// [`Safari`], the MacOS default browser.
///
Expand Down Expand Up @@ -71,6 +71,8 @@ impl KnownBrowser {
#[cfg(target_os = "windows")]
KnownBrowser::Edge => KnownEngine::Chromium(""),
#[cfg(target_os = "macos")]
KnownBrowser::Edge => KnownEngine::Chromium("Microsoft Edge"),
#[cfg(target_os = "macos")]
KnownBrowser::Safari => KnownEngine::Safari,
}
}
Expand Down Expand Up @@ -123,6 +125,8 @@ impl KnownBrowser {
dirs::data_local_dir().map(|p| p.join("Microsoft").join("Edge").join("User Data"))
}
#[cfg(target_os = "macos")]
KnownBrowser::Edge => dirs::data_dir().map(|p| p.join("Microsoft Edge")),
#[cfg(target_os = "macos")]
KnownBrowser::Safari => dirs::home_dir().map(|p| p.join("Library").join("Cookies")),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub fn get_chromium_master_key(name: &str, _path: &std::path::Path) -> Result<Ch
Some(pbkdf2::Algorithm::Pbkdf2Sha1.ident()),
None,
pbkdf2::Params {
rounds: 1,
rounds: 1003,
output_length: 16,
},
salt.as_salt(),
Expand Down

0 comments on commit 5c9a493

Please sign in to comment.