A native macOS application based on SwiftUI + WKWebView, designed for a privacy-first AI chat experience. It enforces "Temporary Chat" mode for AI services and actively blocks access to history, ensuring your conversations are "burn after reading."
- Privacy First:
- Enforces
https://chatgpt.com/?temporary-chat=trueand Gemini's temporary mode. - Automatically blocks history pages (
/c/*), sharing links, and non-whitelisted domains. - Incognito Mode: Supports non-persistent storage configuration (similar to a browser's incognito mode).
- Enforces
- Multi-Tab Management:
- Open multiple ChatGPT or Gemini tabs simultaneously and manage them independently.
- Sidebar-style tab switching, optimized for desktop usage.
- Clean Interface:
- Injects JavaScript/CSS to automatically hide the original website's sidebar, history list, and other distractions.
- Provides a native macOS toolbar: Refresh, Home, and Force New Chat.
- Secure Navigation Engine:
- Built-in
NavigationPolicyEnginestrictly controls page navigation. - Clicking external links (e.g., search citations) triggers a native macOS confirmation prompt to prevent accidental exits.
- Built-in
This is a standard Swift Package Manager (SPM) project.
Requirements:
- macOS 13.0+
- Xcode 15+ (or Swift 5.9+ toolchain installed)
Steps:
- Clone the repository:
git clone https://github.com/yourusername/Private-ChatGPT.git cd Private-ChatGPT - Build the app using the included script (handles icons and directory structure):
chmod +x build_app.sh ./build_app.sh
- Once built,
TemporaryAI.app(or Chinese name临时AI.app) will be generated in thebuild/directory. Drag it to your "Applications" folder.
- Open the project by double-clicking
Package.swiftor runningxed .in the terminal. - Select the
TemporaryAIscheme from the top bar. - Configure Signing & Capabilities (select your Team).
- Click Run (Cmd + R).
This project includes open-source default scripts that hide the sidebar and enforce temporary session behavior.
In the Sources/Resources/ directory, you will find:
chatgpt_default_script.jsgemini_default_script.js
By default the app loads these scripts automatically. You can:
-
Edit Local Files (Recommended for Developers): Modify the files above to adjust DOM behavior (e.g.,
document.querySelector('...').style.display = 'none'). -
Configure in App Settings (Recommended for Users): Launch the App, click the gear icon in the top right to enter Settings -> Scripts.
- You can paste your JavaScript code directly here.
- Scripts in Settings take precedence over local files.
- UI Framework: SwiftUI (AppKit Lifecycle)
- Web Kernel: WKWebView + UserScripts (JS Injection)
- Architecture: MVVM
- Key Modules:
NavigationPolicyEngine: Decides whether each URL navigation is Allowed, Blocked, or Redirected.UserScriptManager: Manages CSS/JS injection.TabManager: Manages multi-tab state.
Issues and Pull Requests are welcome! If you find better DOM hiding rules or want to support new AI services, feel free to contribute.
This project is licensed under the MIT License. You are free to use, modify, and distribute this project. See the LICENSE file for details.
