### Manage and Verify Donut Sync Services Source: https://github.com/zhom/donutbrowser/blob/main/docs/self-hosting-donut-sync.md Commands to start the Docker containers and verify the server's operational status using health and readiness endpoints. ```bash docker compose up -d # Health check curl http://localhost:3929/health # Readiness check (verifies S3 connectivity) curl http://localhost:3929/readyz ``` -------------------------------- ### Manage Browser Extensions Source: https://context7.com/zhom/donutbrowser/llms.txt Facilitates the installation of .xpi, .crx, and .zip extensions. Supports grouping extensions for bulk assignment to browser profiles. ```typescript const extension = await invoke("add_extension", { fileName: "ublock-origin.xpi", fileData: Array.from(new Uint8Array(fileBuffer)) }); const group = await invoke("create_extension_group", { name: "Privacy Extensions" }); await invoke("assign_extension_group_to_profile", { profileId: "profile-uuid", extensionGroupId: group.id }); ``` -------------------------------- ### Configure External S3 Storage Providers Source: https://github.com/zhom/donutbrowser/blob/main/docs/self-hosting-donut-sync.md Alternative Docker Compose service configurations for using AWS S3 or Cloudflare R2 instead of the default MinIO setup. ```yaml # AWS S3 Configuration services: donut-sync: image: donutbrowser/donut-sync:latest ports: - "3929:3929" environment: - SYNC_TOKEN=your-secret-token-here - S3_REGION=us-east-1 - S3_ACCESS_KEY_ID=your-aws-access-key - S3_SECRET_ACCESS_KEY=your-aws-secret-key - S3_BUCKET=your-bucket-name # Cloudflare R2 Configuration services: donut-sync: image: donutbrowser/donut-sync:latest ports: - "3929:3929" environment: - SYNC_TOKEN=your-secret-token-here - S3_ENDPOINT=https://.r2.cloudflarestorage.com - S3_REGION=auto - S3_ACCESS_KEY_ID=your-r2-access-key - S3_SECRET_ACCESS_KEY=your-r2-secret-key - S3_BUCKET=your-bucket-name - S3_FORCE_PATH_STYLE=true ``` -------------------------------- ### Deploy Donut Sync Server Source: https://context7.com/zhom/donutbrowser/llms.txt Infrastructure setup for self-hosting a synchronization server using Docker, including S3-compatible storage configuration and health check verification. ```yaml services: donut-sync: image: donutbrowser/donut-sync:latest ports: - "3929:3929" environment: - SYNC_TOKEN=your-secret-token-here - S3_ENDPOINT=http://minio:9000 - S3_ACCESS_KEY_ID=minioadmin - S3_SECRET_ACCESS_KEY=minioadmin - S3_BUCKET=donut-sync - S3_FORCE_PATH_STYLE=true depends_on: minio: condition: service_healthy minio: image: minio/minio:latest ports: - "9000:9000" command: server /data --console-address ":9001" volumes: - minio_data:/data ``` ```bash docker compose up -d curl http://localhost:3929/health curl http://localhost:3929/readyz ``` -------------------------------- ### Manage MCP Server for AI Integration Source: https://context7.com/zhom/donutbrowser/llms.txt Provides methods to start, stop, and configure the Model Context Protocol (MCP) server for integration with Claude Desktop and Claude Code CLI. These commands facilitate automated browser control by AI agents. ```typescript const port = await invoke("start_mcp_server"); const config = await invoke<{ port: number; token: string } | null>("get_mcp_config"); await invoke("add_mcp_to_claude_desktop"); await invoke("add_mcp_to_claude_code"); const inDesktop = await invoke("is_mcp_in_claude_desktop"); const inCode = await invoke("is_mcp_in_claude_code"); await invoke("stop_mcp_server"); ``` -------------------------------- ### Import Browser Profiles Source: https://context7.com/zhom/donutbrowser/llms.txt Detects and imports existing browser profiles from local installations of Chrome, Firefox, and other supported browsers into Donut Browser. ```typescript const detected = await invoke("detect_existing_profiles"); await invoke("import_browser_profile", { browser: detected[0].mapped_browser, profileName: "Imported Chrome", sourcePath: detected[0].path }); ``` -------------------------------- ### Manage Local REST API Server Source: https://context7.com/zhom/donutbrowser/llms.txt Controls the local API server for external automation and provides examples for interacting with profiles and proxies via HTTP requests. ```typescript await invoke("start_api_server", { port: 10108 }); await invoke("stop_api_server"); const status = await invoke<{ running: boolean; port?: number }>("get_api_server_status"); ``` ```bash curl -X GET "http://localhost:10108/profiles" -H "Authorization: Bearer YOUR_API_TOKEN" curl -X POST "http://localhost:10108/profiles/{profile_id}/launch" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com"}' curl -X POST "http://localhost:10108/profiles" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "API Profile", "browser": "camoufox"}' ``` -------------------------------- ### Configure VPN Connections Source: https://context7.com/zhom/donutbrowser/llms.txt Handles WireGuard and OpenVPN configurations. Allows importing config files, checking connection status, and toggling tunnel states for specific profiles. ```typescript const result = await invoke("import_vpn_config", { content: `[Interface]\nPrivateKey = ...\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = ...\nEndpoint = vpn.example.com:51820\nAllowedIPs = 0.0.0.0/0`, filename: "my-vpn.conf", name: "My VPN" }); await invoke("connect_vpn", { vpnId: vpnConfig.id }); await invoke("update_profile_vpn", { profileId: "profile-uuid", vpnId: vpnConfig.id }); ``` -------------------------------- ### Deploy Donut Sync with Docker Compose Source: https://github.com/zhom/donutbrowser/blob/main/docs/self-hosting-donut-sync.md Defines the services required to run Donut Sync, including an optional MinIO instance for S3-compatible storage. This configuration maps the necessary ports and environment variables for authentication and storage connectivity. ```yaml services: donut-sync: image: donutbrowser/donut-sync:latest ports: - "3929:3929" environment: - SYNC_TOKEN=your-secret-token-here - PORT=3929 - S3_ENDPOINT=http://minio:9000 - S3_REGION=us-east-1 - S3_ACCESS_KEY_ID=minioadmin - S3_SECRET_ACCESS_KEY=minioadmin - S3_BUCKET=donut-sync - S3_FORCE_PATH_STYLE=true depends_on: minio: condition: service_healthy minio: image: minio/minio:latest ports: - "9000:9000" - "9001:9001" environment: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: minioadmin command: server /data --console-address ":9001" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 5s timeout: 5s retries: 5 volumes: - minio_data:/data volumes: minio_data: ``` -------------------------------- ### Configure Application Settings Source: https://context7.com/zhom/donutbrowser/llms.txt Manages global application preferences such as themes, API configurations, and system integration settings like default browser status and login launch behavior. ```typescript const settings = await invoke("get_app_settings"); await invoke("save_app_settings", { settings: { theme: "dark", api_enabled: true, api_port: 10108, mcp_enabled: true, language: "en" } }); await invoke("set_as_default_browser"); const isDefault = await invoke("is_default_browser"); await invoke("enable_launch_on_login"); ``` -------------------------------- ### Configure Cloud Synchronization with TypeScript Source: https://context7.com/zhom/donutbrowser/llms.txt Manages cross-device synchronization settings for profiles, proxies, and extensions. Includes support for end-to-end encryption (E2EE) and manual sync triggers. ```typescript await invoke("save_sync_settings", { syncSettings: { sync_server_url: "https://sync.yourdomain.com", sync_token: "your-secret-token" } }); await invoke("set_profile_sync_mode", { profileId: "profile-uuid", mode: "Regular" }); await invoke("set_e2e_password", { password: "secure-password" }); await invoke("set_proxy_sync_enabled", { proxyId: "proxy-uuid", enabled: true }); await invoke("request_profile_sync", { profileId: "profile-uuid" }); ``` -------------------------------- ### Manage Browser Versions and Updates Source: https://context7.com/zhom/donutbrowser/llms.txt Handles the lifecycle of browser binaries, including checking support, fetching available versions, downloading specific releases, and checking for application updates. ```typescript const browsers = await invoke("get_supported_browsers"); const supported = await invoke("is_browser_supported_on_platform", { browser: "camoufox" }); const versions = await invoke("fetch_browser_versions_with_count", { browser: "camoufox" }); await invoke("download_browser", { browser: "camoufox", version: "135.0" }); const downloaded = await invoke("get_downloaded_browser_versions"); await invoke("check_for_browser_updates"); const updateInfo = await invoke("check_for_app_updates"); ``` -------------------------------- ### Manage Browser Profiles via Tauri API Source: https://context7.com/zhom/donutbrowser/llms.txt Demonstrates how to create, list, launch, and manage isolated browser profiles using the Tauri invoke interface. This includes configuring fingerprint settings for Camoufox and Wayfern engines. ```typescript import { invoke } from "@tauri-apps/api/core"; interface CamoufoxConfig { proxy?: string; screen_max_width?: number; screen_max_height?: number; geoip?: boolean | string; block_images?: boolean; block_webrtc?: boolean; block_webgl?: boolean; os?: "windows" | "macos" | "linux"; randomize_fingerprint_on_launch?: boolean; } interface CreateProfileParams { name: string; browser: "camoufox" | "wayfern"; version: string; release_type: "stable" | "nightly"; proxy_id?: string; vpn_id?: string; camoufox_config?: CamoufoxConfig; group_id?: string; ephemeral?: boolean; } // Create a Camoufox profile with fingerprint spoofing const profile = await invoke("create_browser_profile_new", { name: "Shopping Profile", browser: "camoufox", version: "135.0", releaseType: "stable", proxyId: "my-proxy-id", camoufoxConfig: { geoip: true, block_webrtc: true, os: "windows", screen_max_width: 1920, screen_max_height: 1080 }, groupId: "work-profiles-group" }); // List all profiles const profiles = await invoke("list_browser_profiles"); // Launch a profile with optional URL await invoke("launch_browser_profile", { profileId: profile.id, url: "https://example.com" }); // Check if browser is running const isRunning = await invoke("check_browser_status", { profileId: profile.id }); // Kill running browser await invoke("kill_browser_profile", { profileId: profile.id }); // Clone a profile with new name await invoke("clone_profile", { profileId: profile.id, newName: "Shopping Profile Copy" }); // Delete profile await invoke("delete_profile", { profileId: profile.id }); ``` -------------------------------- ### Manage Network Proxies in Donut Browser Source: https://context7.com/zhom/donutbrowser/llms.txt Provides methods to create, validate, update, and assign proxy settings. Supports static credentials, dynamic rotation URLs, and bulk parsing from text files. ```typescript interface ProxySettings { proxy_type: "http" | "https" | "socks4" | "socks5"; host: string; port: number; username?: string; password?: string; } const proxy = await invoke("create_stored_proxy", { name: "US Residential", proxySettings: { proxy_type: "socks5", host: "proxy.example.com", port: 1080, username: "user", password: "pass" } }); const dynamicProxy = await invoke("create_stored_proxy", { name: "Rotating Proxy", dynamicProxyUrl: "https://api.proxyservice.com/get-proxy", dynamicProxyFormat: "json" }); const result = await invoke("check_proxy_validity", { proxyId: proxy.id }); await invoke("update_profile_proxy", { profileId: "profile-uuid", proxyId: proxy.id }); ``` -------------------------------- ### Cloud Sync Management Source: https://context7.com/zhom/donutbrowser/llms.txt Configure and manage cloud synchronization for profiles, proxies, groups, and extensions across devices. Supports cloud-hosted and self-hosted sync servers with optional end-to-end encryption. ```APIDOC ## Cloud Sync ### Description Synchronize profiles, proxies, groups, and extensions across devices using cloud-hosted or self-hosted sync servers. Supports optional end-to-end encryption. ### Method - `save_sync_settings` - `set_profile_sync_mode` - `set_e2e_password` - `check_has_e2e_password` - `set_proxy_sync_enabled` - `set_group_sync_enabled` - `set_vpn_sync_enabled` - `request_profile_sync` - `get_sync_settings` ### Parameters #### `save_sync_settings` - **syncSettings** (object) - Required - The sync settings object. - **sync_server_url** (string) - Required - The URL of the sync server. - **sync_token** (string) - Required - The authentication token for the sync server. #### `set_profile_sync_mode` - **profileId** (string) - Required - The ID of the profile. - **mode** (string) - Required - The sync mode: `Regular`, `Encrypted`, or `Disabled`. #### `set_e2e_password` - **password** (string) - Required - The end-to-end encryption password. #### `check_has_e2e_password` No parameters. #### `set_proxy_sync_enabled` - **proxyId** (string) - Required - The ID of the proxy. - **enabled** (boolean) - Required - Whether to enable sync for the proxy. #### `set_group_sync_enabled` - **groupId** (string) - Required - The ID of the group. - **enabled** (boolean) - Required - Whether to enable sync for the group. #### `set_vpn_sync_enabled` - **vpnId** (string) - Required - The ID of the VPN. - **enabled** (boolean) - Required - Whether to enable sync for the VPN. #### `request_profile_sync` - **profileId** (string) - Required - The ID of the profile to sync. #### `get_sync_settings` No parameters. ### Request Example (Save Sync Settings) ```typescript await invoke("save_sync_settings", { syncSettings: { sync_server_url: "https://sync.yourdomain.com", sync_token: "your-secret-token" } }); ``` ### Response Example (Check E2E Password) ```typescript // Result of invoke("check_has_e2e_password") true ``` ``` -------------------------------- ### Local REST API Source: https://context7.com/zhom/donutbrowser/llms.txt Enable and interact with the local REST API server for automation and integration. Provides programmatic access to profile and proxy management. ```APIDOC ## Local REST API ### Description Enable the local API server for automation and integration with external tools. The API provides programmatic access to all profile and proxy management features. ### Method - `start_api_server` - `stop_api_server` - `get_api_server_status` ### Parameters #### `start_api_server` - **port** (number) - Required - The port to start the API server on. #### `stop_api_server` No parameters. #### `get_api_server_status` No parameters. ### Request Example (Start API Server) ```typescript await invoke("start_api_server", { port: 10108 }); ``` ### Response Example (API Server Status) ```typescript // Result of invoke<{ running: boolean; port?: number }>("get_api_server_status") { "running": true, "port": 10108 } ``` ## REST API Endpoints (via curl) ### List Profiles ```bash curl -X GET "http://localhost:10108/profiles" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Launch Profile ```bash curl -X POST "http://localhost:10108/profiles/{profile_id}/launch" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com"}' ``` ### Create Profile ```bash curl -X POST "http://localhost:10108/profiles" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "API Profile", "browser": "camoufox", "version": "135.0", "release_type": "stable", "camoufox_config": { "geoip": true, "block_webrtc": true } }' ``` ### Get Profile Status ```bash curl -X GET "http://localhost:10108/profiles/{profile_id}/status" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### Kill Browser ```bash curl -X POST "http://localhost:10108/profiles/{profile_id}/kill" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ### List Proxies ```bash curl -X GET "http://localhost:10108/proxies" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ``` -------------------------------- ### Manage Profile Groups with TypeScript Source: https://context7.com/zhom/donutbrowser/llms.txt Provides methods to create, update, and organize browser profiles into groups. These functions allow for bulk operations such as assigning multiple profiles to a group or deleting specific profile sets. ```typescript const group = await invoke("create_profile_group", { name: "Work Profiles" }); const groups = await invoke("get_groups_with_profile_counts"); await invoke("assign_profiles_to_group", { profileIds: ["profile-1", "profile-2"], groupId: group.id }); await invoke("update_profile_group", { groupId: group.id, name: "Work & Business" }); await invoke("delete_selected_profiles", { profileIds: ["profile-1", "profile-2"] }); await invoke("delete_profile_group", { groupId: group.id }); ``` -------------------------------- ### Configure Caddy Reverse Proxy for Donutbrowser Source: https://github.com/zhom/donutbrowser/blob/main/docs/self-hosting-donut-sync.md This snippet shows how to configure Caddy to act as a reverse proxy for Donutbrowser. It directs traffic for 'sync.yourdomain.com' to the local instance running on port 3929. Caddy handles SSL termination and proxying automatically. ```caddy sync.yourdomain.com { reverse_proxy localhost:3929 } ``` -------------------------------- ### Profile Management API Source: https://context7.com/zhom/donutbrowser/llms.txt This section details the API endpoints for managing browser profiles within Donut Browser. It includes operations for creating, listing, launching, cloning, checking status, and deleting profiles. ```APIDOC ## Create Browser Profile ### Description Creates a new isolated browser profile with specified configurations. ### Method POST ### Endpoint /create_browser_profile_new ### Parameters #### Request Body - **name** (string) - Required - The name of the browser profile. - **browser** (string) - Required - The browser engine to use ('camoufox' or 'wayfern'). - **version** (string) - Required - The browser version. - **release_type** (string) - Required - The release type ('stable' or 'nightly'). - **proxy_id** (string) - Optional - The ID of the proxy to associate with the profile. - **vpn_id** (string) - Optional - The ID of the VPN to associate with the profile. - **camoufox_config** (object) - Optional - Configuration for Camoufox engine. - **proxy** (string) - Optional - Proxy string for Camoufox. - **screen_max_width** (number) - Optional - Maximum screen width. - **screen_max_height** (number) - Optional - Maximum screen height. - **geoip** (boolean | string) - Optional - Enable GeoIP spoofing (true for auto-detect, or specific IP). - **block_images** (boolean) - Optional - Block images. - **block_webrtc** (boolean) - Optional - Block WebRTC. - **block_webgl** (boolean) - Optional - Block WebGL. - **os** (string) - Optional - Operating system ('windows', 'macos', 'linux'). - **randomize_fingerprint_on_launch** (boolean) - Optional - Randomize fingerprint on launch. - **group_id** (string) - Optional - The ID of the group to assign the profile to. - **ephemeral** (boolean) - Optional - Whether the profile should be ephemeral. ### Request Example ```json { "name": "Shopping Profile", "browser": "camoufox", "version": "135.0", "releaseType": "stable", "proxyId": "my-proxy-id", "camoufoxConfig": { "geoip": true, "block_webrtc": true, "os": "windows", "screen_max_width": 1920, "screen_max_height": 1080 }, "groupId": "work-profiles-group" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created profile. #### Response Example ```json { "id": "profile-uuid-12345" } ``` ## List Browser Profiles ### Description Retrieves a list of all existing browser profiles. ### Method GET ### Endpoint /list_browser_profiles ### Parameters None ### Response #### Success Response (200) - **profiles** (array) - An array of browser profile objects. - Each object contains profile details like id, name, browser type, etc. #### Response Example ```json [ { "id": "profile-uuid-12345", "name": "Shopping Profile", "browser": "camoufox", "version": "135.0", "releaseType": "stable" }, { "id": "profile-uuid-67890", "name": "Work Profile", "browser": "wayfern", "version": "120.0", "releaseType": "nightly" } ] ``` ## Launch Browser Profile ### Description Launches a specified browser profile, optionally navigating to a given URL. ### Method POST ### Endpoint /launch_browser_profile ### Parameters #### Request Body - **profileId** (string) - Required - The ID of the profile to launch. - **url** (string) - Optional - The URL to open in the launched browser. ### Request Example ```json { "profileId": "profile-uuid-12345", "url": "https://example.com" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the launch operation. #### Response Example ```json { "status": "success" } ``` ## Check Browser Status ### Description Checks if a browser profile is currently running. ### Method POST ### Endpoint /check_browser_status ### Parameters #### Request Body - **profileId** (string) - Required - The ID of the profile to check. ### Request Example ```json { "profileId": "profile-uuid-12345" } ``` ### Response #### Success Response (200) - **isRunning** (boolean) - True if the browser is running, false otherwise. #### Response Example ```json { "isRunning": true } ``` ## Kill Browser Profile ### Description Terminates the running browser process for a specified profile. ### Method POST ### Endpoint /kill_browser_profile ### Parameters #### Request Body - **profileId** (string) - Required - The ID of the profile to kill. ### Request Example ```json { "profileId": "profile-uuid-12345" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the kill operation. #### Response Example ```json { "status": "success" } ``` ## Clone Profile ### Description Creates a copy of an existing browser profile with a new name. ### Method POST ### Endpoint /clone_profile ### Parameters #### Request Body - **profileId** (string) - Required - The ID of the profile to clone. - **newName** (string) - Required - The desired name for the new cloned profile. ### Request Example ```json { "profileId": "profile-uuid-12345", "newName": "Shopping Profile Copy" } ``` ### Response #### Success Response (200) - **newProfileId** (string) - The ID of the newly created cloned profile. #### Response Example ```json { "newProfileId": "profile-uuid-abcde" } ``` ## Delete Profile ### Description Deletes a specified browser profile and all its associated data. ### Method POST ### Endpoint /delete_profile ### Parameters #### Request Body - **profileId** (string) - Required - The ID of the profile to delete. ### Request Example ```json { "profileId": "profile-uuid-12345" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the delete operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Configure Nginx Reverse Proxy for Donutbrowser Source: https://github.com/zhom/donutbrowser/blob/main/docs/self-hosting-donut-sync.md This snippet demonstrates configuring Nginx as a reverse proxy for Donutbrowser. It sets up SSL for 'sync.yourdomain.com' and forwards requests to 'http://localhost:3929'. Essential proxy headers are included for proper request handling by the backend application. ```nginx server { listen 443 ssl; server_name sync.yourdomain.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; location / { proxy_pass http://localhost:3929; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` -------------------------------- ### Profile Group Management Source: https://context7.com/zhom/donutbrowser/llms.txt Manage profile groups for organization and bulk operations. Includes creating, retrieving, assigning profiles, updating, and deleting groups. ```APIDOC ## Profile Groups ### Description Organize profiles into groups for bulk operations and better management. ### Method - `create_profile_group` - `get_groups_with_profile_counts` - `assign_profiles_to_group` - `update_profile_group` - `delete_profile_group` ### Parameters #### `create_profile_group` - **name** (string) - Required - The name of the new profile group. #### `get_groups_with_profile_counts` No parameters. #### `assign_profiles_to_group` - **profileIds** (string[]) - Required - An array of profile IDs to assign to the group. - **groupId** (string) - Required - The ID of the group to assign profiles to. #### `update_profile_group` - **groupId** (string) - Required - The ID of the group to update. - **name** (string) - Required - The new name for the profile group. #### `delete_profile_group` - **groupId** (string) - Required - The ID of the group to delete. ### Request Example (Create Group) ```typescript await invoke("create_profile_group", { name: "Work Profiles" }); ``` ### Response Example (Get Groups) ```typescript // Result of invoke("get_groups_with_profile_counts") [ { "id": "group-id-1", "name": "Work Profiles", "profile_count": 5 } ] ``` ``` -------------------------------- ### Handle Profile Cookies with TypeScript Source: https://context7.com/zhom/donutbrowser/llms.txt Enables reading, copying, importing, and exporting cookies between profiles. Supports both Camoufox and Wayfern formats with options for merging or replacing existing data. ```typescript const result = await invoke("read_profile_cookies", { profileId: "profile-uuid" }); const copyResults = await invoke("copy_profile_cookies", { request: { source_profile_id: "source-profile", target_profile_ids: ["target-1", "target-2"], domains: ["example.com", "google.com"], merge_mode: "replace" } }); const importResult = await invoke("import_cookies_from_file", { profileId: "profile-uuid", content: "# Netscape HTTP Cookie File\n.example.com\tTRUE\t/\tFALSE\t1735689600\tsession_id\tabc123" }); const exported = await invoke("export_profile_cookies", { profileId: "profile-uuid", format: "json" }); ``` -------------------------------- ### Monitor Traffic Statistics Source: https://context7.com/zhom/donutbrowser/llms.txt Retrieves bandwidth usage data per profile. Supports fetching all snapshots or filtering by specific time periods to analyze network activity. ```typescript const snapshots = await invoke("get_all_traffic_snapshots"); const stats = await invoke("get_traffic_stats_for_period", { profileId: "profile-uuid", seconds: 3600 }); await invoke("clear_all_traffic_stats"); ``` -------------------------------- ### Cookie Management Source: https://context7.com/zhom/donutbrowser/llms.txt Perform operations on cookies, including reading, copying, importing, and exporting. Supports Camoufox (Firefox/SQLite) and Wayfern (Chromium/encrypted) formats. ```APIDOC ## Cookie Management ### Description Read, copy, import, and export cookies between profiles. Supports Camoufox (Firefox/SQLite) and Wayfern (Chromium/encrypted) cookie formats. ### Method - `read_profile_cookies` - `copy_profile_cookies` - `import_cookies_from_file` - `export_profile_cookies` ### Parameters #### `read_profile_cookies` - **profileId** (string) - Required - The ID of the profile to read cookies from. #### `copy_profile_cookies` - **request** (object) - Required - The request object for copying cookies. - **source_profile_id** (string) - Required - The ID of the source profile. - **target_profile_ids** (string[]) - Required - An array of target profile IDs. - **domains** (string[]) - Optional - An array of specific domains to copy cookies for. - **merge_mode** (string) - Required - The merge mode: `replace` or `merge`. #### `import_cookies_from_file` - **profileId** (string) - Required - The ID of the profile to import cookies into. - **content** (string) - Required - The cookie content in Netscape or JSON format. #### `export_profile_cookies` - **profileId** (string) - Required - The ID of the profile to export cookies from. - **format** (string) - Required - The export format: `json` or `netscape`. ### Request Example (Copy Cookies) ```typescript await invoke("copy_profile_cookies", { request: { source_profile_id: "source-profile", target_profile_ids: ["target-1", "target-2"], domains: ["example.com", "google.com"], merge_mode: "replace" } }); ``` ### Response Example (Read Cookies) ```typescript // Result of invoke("read_profile_cookies", { profileId: "profile-uuid" }) { "domains": [ { "domain": "example.com", "cookie_count": 10 } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.