mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-08-05 18:58:40 +02:00
feat: add cookies copying functionality
This commit is contained in:
+17
-1
@@ -35,6 +35,7 @@ pub mod sync;
|
||||
pub mod traffic_stats;
|
||||
mod wayfern_manager;
|
||||
// mod theme_detector; // removed: theme detection handled in webview via CSS prefers-color-scheme
|
||||
mod cookie_manager;
|
||||
mod tag_manager;
|
||||
mod version_updater;
|
||||
|
||||
@@ -221,6 +222,19 @@ fn get_cached_proxy_check(proxy_id: String) -> Option<crate::proxy_manager::Prox
|
||||
crate::proxy_manager::PROXY_MANAGER.get_cached_proxy_check(&proxy_id)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn read_profile_cookies(profile_id: String) -> Result<cookie_manager::CookieReadResult, String> {
|
||||
cookie_manager::CookieManager::read_cookies(&profile_id)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn copy_profile_cookies(
|
||||
app_handle: tauri::AppHandle,
|
||||
request: cookie_manager::CookieCopyRequest,
|
||||
) -> Result<Vec<cookie_manager::CookieCopyResult>, String> {
|
||||
cookie_manager::CookieManager::copy_cookies(&app_handle, request).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn is_geoip_database_available() -> Result<bool, String> {
|
||||
Ok(GeoIPDownloader::is_geoip_database_available())
|
||||
@@ -825,7 +839,9 @@ pub fn run() {
|
||||
set_proxy_sync_enabled,
|
||||
set_group_sync_enabled,
|
||||
is_proxy_in_use_by_synced_profile,
|
||||
is_group_in_use_by_synced_profile
|
||||
is_group_in_use_by_synced_profile,
|
||||
read_profile_cookies,
|
||||
copy_profile_cookies
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
Reference in New Issue
Block a user