Support setting incognita mode

This commit is contained in:
Tw93
2025-08-14 17:00:26 +08:00
parent 8313d9142b
commit 7a4f4c6d3d
9 changed files with 31 additions and 1 deletions

8
bin/README.md vendored
View File

@@ -224,6 +224,14 @@ Hide the window instead of exiting when clicking the close button. Default is `t
--hide-on-close
```
#### [incognito]
Launch the application in incognito/private browsing mode. Default is `false`. When enabled, the webview will run in private mode, which means it won't store cookies, local storage, or browsing history. This is useful for privacy-sensitive applications.
```shell
--incognito
```
#### [installer-language]
Set the Windows Installer language. Options include `zh-CN`, `ja-JP`, More at [Tauri Document](https://tauri.app/distribute/windows-installer/#internationalization). Default is `en-US`.

8
bin/README_CN.md vendored
View File

@@ -224,6 +224,14 @@ pake [url] [options]
--hide-on-close
```
#### [incognito]
以隐私/隐身浏览模式启动应用程序。默认为 `false`。启用后webview 将在隐私模式下运行,这意味着它不会存储 cookie、本地存储或浏览历史记录。这对于注重隐私的应用程序很有用。
```shell
--incognito
```
#### [installer-language]
设置 Windows 安装包语言。支持 `zh-CN`、`ja-JP`,更多在 [Tauri 文档](https://tauri.app/distribute/windows-installer/#internationalization)。默认为 `en-US`。

5
bin/cli.ts vendored
View File

@@ -128,6 +128,11 @@ program
.default(DEFAULT.hideOnClose)
.hideHelp(),
)
.addOption(
new Option('--incognito', 'Launch app in incognito/private mode').default(
DEFAULT.incognito,
),
)
.addOption(
new Option('--installer-language <string>', 'Installer language')
.default(DEFAULT.installerLanguage)

1
bin/defaults.ts vendored
View File

@@ -23,6 +23,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
inject: [],
installerLanguage: 'en-US',
hideOnClose: true,
incognito: false,
};
// Just for cli development

View File

@@ -33,6 +33,7 @@ export async function mergeConfig(
proxyUrl,
installerLanguage,
hideOnClose,
incognito,
} = options;
const { platform } = process;
@@ -49,6 +50,7 @@ export async function mergeConfig(
dark_mode: darkMode,
disabled_web_shortcuts: disabledWebShortcuts,
hide_on_close: hideOnClose,
incognito: incognito,
};
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });

3
bin/types.ts vendored
View File

@@ -71,6 +71,9 @@ export interface PakeCliOptions {
// Hide window on close instead of exiting, default false
hideOnClose: boolean;
// Launch app in incognito/private mode, default false
incognito: boolean;
}
export interface PakeAppOptions extends PakeCliOptions {