Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

feat: add incognito mode and window size options for app packaging

Tw93e3a6e7c57e3d
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 259d9b60..910f26db 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -97,6 +97,9 @@ jobs:
url: ${{ matrix.config.url }}
icon: ${{ matrix.config.icon }}
new_window: ${{ matrix.config.new_window || false }}
+ incognito: ${{ matrix.config.incognito || false }}
+ width: ${{ matrix.config.width || 1200 }}
+ height: ${{ matrix.config.height || 780 }}
# Publish Docker image (runs in parallel with app builds)
publish-docker:
diff --git a/.github/workflows/single-app.yaml b/.github/workflows/single-app.yaml
index 80ffd0c4..a3b0c5e6 100644
--- a/.github/workflows/single-app.yaml
+++ b/.github/workflows/single-app.yaml
@@ -30,6 +30,18 @@ on:
description: "Allow sites to open new windows"
required: false
default: false
+ incognito:
+ description: "Enable incognito mode"
+ required: false
+ default: false
+ width:
+ description: "Window width"
+ required: false
+ default: 1200
+ height:
+ description: "Window height"
+ required: false
+ default: 780
workflow_call:
inputs:
name:
@@ -61,6 +73,21 @@ on:
type: boolean
required: false
default: false
+ incognito:
+ description: "Enable incognito mode"
+ type: boolean
+ required: false
+ default: false
+ width:
+ description: "Window width"
+ type: number
+ required: false
+ default: 1200
+ height:
+ description: "Window height"
+ type: number
+ required: false
+ default: 780
secrets:
PAKE_SIGNING_IDENTITY:
required: false
@@ -187,6 +214,13 @@ jobs:
ARGS+=("--new-window")
fi
+ if [ "${{ inputs.incognito }}" = "true" ]; then
+ ARGS+=("--incognito")
+ fi
+
+ ARGS+=("--width" "${{ inputs.width }}")
+ ARGS+=("--height" "${{ inputs.height }}")
+
# Build once with multiple targets (faster than separate builds)
node dist/cli.js "${ARGS[@]}" --targets deb,appimage
@@ -234,6 +268,13 @@ jobs:
ARGS+=("--new-window")
fi
+ if [ "${{ inputs.incognito }}" = "true" ]; then
+ ARGS+=("--incognito")
+ fi
+
+ ARGS+=("--width" "${{ inputs.width }}")
+ ARGS+=("--height" "${{ inputs.height }}")
+
node dist/cli.js "${ARGS[@]}" --targets universal --multi-arch
mkdir -p output/macos
@@ -303,6 +344,13 @@ jobs:
$args += "--new-window"
}
+ if ("${{ inputs.incognito }}" -eq "true") {
+ $args += "--incognito"
+ }
+
+ $args += "--width", "${{ inputs.width }}"
+ $args += "--height", "${{ inputs.height }}"
+
$args += "--targets", "x64"
node dist/cli.js $args
diff --git a/default_app_list.json b/default_app_list.json
index e0e68983..773b3c75 100644
--- a/default_app_list.json
+++ b/default_app_list.json
@@ -3,7 +3,10 @@
"name": "wechat",
"title": "WeChat",
"name_zh": "微信",
- "url": "https://wx.qq.com/"
+ "url": "https://wx.qq.com/",
+ "incognito": true,
+ "width": 1000,
+ "height": 720
},
{
"name": "deepseek",
diff --git a/docs/faq.md b/docs/faq.md
index 6c9a8cbc..edbeda1b 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -385,6 +385,14 @@ This is usually due to web compatibility issues. Try:
Some authentication providers, especially Google, may block sign-in inside embedded webviews. Because Pake packages sites into a desktop webview, Google properties or sites that rely on Google OAuth may still fail to sign in even when `--new-window` or `--multi-window` is enabled. This is provider policy, not a packaging bug. In those cases, use the normal browser, a browser-installed app, or a native desktop client.
+5. **WeChat Web login environment error**
+
+ WeChat detects the WebView and writes a flag cookie that blocks subsequent logins. Add `--incognito` when packaging to bypass it, at the cost of requiring a QR scan on every launch:
+
+ ```bash
+ pake https://wx.qq.com --name WeChat --incognito
+ ```
+
---
## Installation Issues
diff --git a/docs/faq_CN.md b/docs/faq_CN.md
index ee08b8de..87085ec7 100644
--- a/docs/faq_CN.md
+++ b/docs/faq_CN.md
@@ -385,6 +385,14 @@ Pake 可以自动转换图标,但提供正确的格式更可靠。
某些认证提供方,尤其是 Google,可能会阻止在嵌入式 WebView 中完成登录。由于 Pake 是把网站包装进桌面 WebView,Google 自家站点或依赖 Google OAuth 的网站,即使启用了 `--new-window` 或 `--multi-window`,也仍然可能无法在应用内完成登录。这属于提供方策略限制,不是打包逻辑错误。遇到这种情况时,建议改用普通浏览器、浏览器安装版站点应用,或官方原生桌面客户端。
+5. **微信 Web 版登录环境异常**
+
+ 微信检测到 WebView 后会写入标记 Cookie,导致后续持续被拦截。打包时加 `--incognito` 可解决,代价是每次启动都需要重新扫码登录:
+
+ ```bash
+ pake https://wx.qq.com --name WeChat --incognito
+ ```
+
---
## 安装问题