Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

fix(profile): gate macOS keychain imports

SpringCorelf81730fb1c59
diff --git a/moli-cookie-import/src/chrome.rs b/moli-cookie-import/src/chrome.rs
index 68aaf1d77..ab18588f4 100644
--- a/moli-cookie-import/src/chrome.rs
+++ b/moli-cookie-import/src/chrome.rs
@@ -1,4 +1,7 @@
-use std::{collections::BTreeMap, fs, path::Path, process::Command};
+use std::{collections::BTreeMap, fs, path::Path};
+
+#[cfg(target_os = "macos")]
+use std::process::Command;
use anyhow::{Context, Result, anyhow, bail};
use base64::{Engine as _, engine::general_purpose::STANDARD};
@@ -6,9 +9,9 @@ use moli_cookie_jar::{
CookiePriority, StoredCookie, StoredCookiePartitionKey, StoredCookieSameSite,
StoredCookieSourceScheme,
};
-use moli_crypto::{
- aes_128_cbc_pkcs7_decrypt, aes_256_gcm_decrypt, derive_pbkdf2_hmac_sha1, sha256_digest,
-};
+#[cfg(target_os = "macos")]
+use moli_crypto::derive_pbkdf2_hmac_sha1;
+use moli_crypto::{aes_128_cbc_pkcs7_decrypt, aes_256_gcm_decrypt, sha256_digest};
use rusqlite::Connection;
use rusty_leveldb::{DB, LdbIterator, Options};
use tempfile::TempDir;