decrypt_cookies/browser/
mod.rs1#[cfg(any(feature = "chromium", feature = "firefox"))]
2macro_rules! push_exact {
3 ($base:ident, $val:path) => {
4 let mut additional = $val.len();
5 if crate::utils::need_sep(&$base) {
6 additional += 1;
7 }
8 $base.reserve_exact(additional);
9
10 $base.push($val);
11 };
12}
13
14#[cfg(any(feature = "chromium", feature = "firefox"))]
15macro_rules! push_temp {
16 ($cache:ident, $val:path) => {
17 let mut $cache = dirs::cache_dir()?;
18 $cache.reserve_exact(CACHE_PATH.len() + Self::NAME.len() + $val.len() + 3);
19 $cache.push(CACHE_PATH);
20 $cache.push(Self::NAME);
21 $cache.push($val);
22 };
23}
24
25pub mod cookies;
26
27#[cfg(feature = "chromium")]
28pub mod chromium;
29#[cfg(feature = "chromium")]
30pub use chromium::*;
31
32#[cfg(feature = "firefox")]
33pub mod firefox;
34#[cfg(feature = "firefox")]
35pub use firefox::*;
36
37#[cfg(any(feature = "chromium", feature = "firefox"))]
38const CACHE_PATH: &str = "decrypt-cookies";
39
40#[cfg(feature = "linkme")]
41#[linkme::distributed_slice]
42pub static BROWSERS: [&str];
44
45#[cfg(feature = "linkme")]
46#[test]
47fn linkme_work() {
48 assert!(BROWSERS.contains(&"Firefox"));
49 assert!(BROWSERS.contains(&"Librewolf"));
50
51 assert!(BROWSERS.contains(&"Edge"));
52 assert!(BROWSERS.contains(&"Chrome"));
53
54 #[cfg(not(target_os = "linux"))]
55 assert!(BROWSERS.contains(&"CocCoc"));
56 #[cfg(not(target_os = "linux"))]
57 assert!(BROWSERS.contains(&"Arc"));
58}