✨ Support setting incognita mode
This commit is contained in:
8
bin/README.md
vendored
8
bin/README.md
vendored
@@ -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
8
bin/README_CN.md
vendored
@@ -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
5
bin/cli.ts
vendored
@@ -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
1
bin/defaults.ts
vendored
@@ -23,6 +23,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
|
||||
inject: [],
|
||||
installerLanguage: 'en-US',
|
||||
hideOnClose: true,
|
||||
incognito: false,
|
||||
};
|
||||
|
||||
// Just for cli development
|
||||
|
||||
2
bin/helpers/merge.ts
vendored
2
bin/helpers/merge.ts
vendored
@@ -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
3
bin/types.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"dark_mode": false,
|
||||
"activation_shortcut": "",
|
||||
"disabled_web_shortcuts": false,
|
||||
"hide_on_close": true
|
||||
"hide_on_close": true,
|
||||
"incognito": false
|
||||
}
|
||||
],
|
||||
"user_agent": {
|
||||
|
||||
@@ -14,6 +14,7 @@ pub struct WindowConfig {
|
||||
pub disabled_web_shortcuts: bool,
|
||||
pub activation_shortcut: String,
|
||||
pub hide_on_close: bool,
|
||||
pub incognito: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
||||
@@ -37,6 +37,7 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
|
||||
.inner_size(window_config.width, window_config.height)
|
||||
.always_on_top(window_config.always_on_top)
|
||||
.disable_drag_drop_handler()
|
||||
.incognito(window_config.incognito)
|
||||
.initialization_script(&config_script)
|
||||
.initialization_script(include_str!("../inject/component.js"))
|
||||
.initialization_script(include_str!("../inject/event.js"))
|
||||
|
||||
Reference in New Issue
Block a user