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.

docs: package Gmail by its final origin

Tw93afe5fc339003
diff --git a/AGENTS.md b/AGENTS.md
index af1f4d2a..ced60687 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -116,7 +116,7 @@ Oracles per row live under `tests/unit/` (for example `event-link-guard.test.js`
- New user-visible CLI surface (a new flag, alias, subcommand, or extra help variant) needs a stated justification before implementation: name the user problem and why an existing flag, config key, or default cannot cover it, then get maintainer sign-off. Prefer quieter defaults over new options; never split help output into parallel variants.
- Window/runtime options with platform-sensitive behavior include `--incognito`, `--new-window`, `--min-width`, `--min-height`, `--maximize`, multi-window behavior, notification click handling, and Linux/Wayland WebKit compositing defaults.
- `--incognito` intentionally trades persistence for clean private sessions; be careful around login, cookies, local storage, and WeChat-style WebView detection.
-- Windows `--password-autosave` is opt-in and disabled in private windows. Every window creation must apply both true and false through `ICoreWebView2Settings4::SetIsPasswordAutosaveEnabled`; do not treat the false case as a no-op. Legacy configs default to false. This controls new save/update prompts, not existing password autofill or general autofill, and does not share an Edge or Chrome profile. Keep the native bool, CLI/config surface, and both language docs consistent; cover all four requested/private combinations and the missing-field default in `tests/unit/password-autosave.test.ts` and Rust tests.
+- Windows `--password-autosave` is opt-in and disabled in private windows. Every window creation must apply both true and false through `ICoreWebView2Settings4::SetIsPasswordAutosaveEnabled`; do not treat the false case as a no-op. Legacy configs default to false. This controls new save/update prompts, not existing password autofill or general autofill, and does not share an Edge or Chrome profile. Keep the native bool, CLI/config surface, and both language docs consistent; cover all four requested/private combinations and the missing-field default in the `config.rs` Rust tests, and keep `tests/unit/password-autosave.test.ts` asserting that both values reach the native call.
- `--new-window` and `--multi-window` do not bypass every provider policy. Google OAuth and similar embedded-WebView restrictions may still require a normal browser or native client.
- macOS Basic Auth keeps only an enablement boolean in CLI/config. Usernames and passwords are runtime-only input for the target host and session; never put them in CLI arguments, config, generated artifacts, logs, or persistence. Native dialog changes need a real macOS smoke covering the icon, button alignment, label/input baselines, field width, and outer margins; compile and unit tests do not prove the layout.
- macOS auth-popup behavior is fragile. Auth and sign-in URLs that trigger WebKit's native auth-popup path should stay in the current window when that path can abort the app. URL matching lives in `src-tauri/src/inject/auth.js` (`matchesAuthUrl`, injected from `src-tauri/src/app/window.rs`) and is covered by `tests/unit/auth-sso-patterns.test.js`; main-page `window.open` interception lives in `event.js`, and the lightweight subframe interception lives in `frame_links.js`. Changes need the corresponding routing tests. Apple Sign-In (`appleid.apple.com` / `AppleAuthentication` named windows) is the exception and must keep the native `window.open` popup.
diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md
index a6d56511..d468c824 100644
--- a/docs/advanced-usage.md
+++ b/docs/advanced-usage.md
@@ -80,7 +80,7 @@ The download system automatically handles:
Send messages between web content and Pake container.
-Native IPC is available to bundled local pages and the exact configured website origin (scheme, host, and port). Login redirects and other origins do not receive native permissions. Use the final website URL when packaging an app, including its `www` or workspace subdomain. On other origins, native notifications, zoom, Pake's fullscreen controls, and opening links in the system browser are unavailable; downloads fall back to the browser, which may display cross-origin media instead of saving it. Custom commands must be registered in both `generate_handler!` and the command manifest in `src-tauri/build.rs`, with the corresponding permission added to `src-tauri/capabilities/default.json`.
+Native IPC is available to bundled local pages and the exact configured website origin (scheme, host, and port). Login redirects and other origins do not receive native permissions. Use the final website URL when packaging an app, including its `www` or workspace subdomain. On other origins, native notifications, zoom, Pake's fullscreen controls, dragging the window by its hidden title bar, and opening links in the system browser are unavailable; downloads fall back to the browser, which may display cross-origin media instead of saving it. Custom commands must be registered in both `generate_handler!` and the command manifest in `src-tauri/build.rs`, with the corresponding permission added to `src-tauri/capabilities/default.json`.
**Web Side (JavaScript):**
@@ -154,8 +154,8 @@ macOS will prompt the user for permission on first use. Only add these flags for
If you need separate apps for the same site, for example two Gmail accounts with different login state, build them with different app names:
```bash
-pake https://gmail.com --name "Gmail Work"
-pake https://gmail.com --name "Gmail Personal"
+pake https://mail.google.com --name "Gmail Work"
+pake https://mail.google.com --name "Gmail Personal"
```
Pake now generates a different app identifier for each `URL + name` pair, so these apps can be installed as separate desktop apps instead of resolving to the same app.
@@ -163,7 +163,7 @@ Pake now generates a different app identifier for each `URL + name` pair, so the
For advanced cases, Pake also supports a hidden `--identifier` option if you need to pin the bundle identifier explicitly:
```bash
-pake https://gmail.com --name "Gmail Work" --identifier com.example.gmail.work
+pake https://mail.google.com --name "Gmail Work" --identifier com.example.gmail.work
```
`--multi-instance` is different. It only allows multiple processes for the same packaged app, it does not create separate app identities.
diff --git a/docs/advanced-usage_CN.md b/docs/advanced-usage_CN.md
index 5c8b5828..247bbd0f 100644
--- a/docs/advanced-usage_CN.md
+++ b/docs/advanced-usage_CN.md
@@ -80,7 +80,7 @@ if (window.Notification && Notification.permission === "default") {
在网页内容和 Pake 容器之间发送消息。
-原生 IPC 只开放给打包的本地页面和配置的网站来源,协议、主机名和端口都要一致,登录跳转和其他来源不会获得原生权限,打包时使用网站最终打开的网址,包括 `www` 或工作区子域。在其他来源的页面上,原生通知、缩放、Pake 的全屏控制和通过系统浏览器打开链接不可用,下载会交给网页浏览器处理,跨域图片等资源可能直接显示而不保存。自定义命令需要同时注册到 `generate_handler!` 和 `src-tauri/build.rs` 的命令清单,并在 `src-tauri/capabilities/default.json` 中添加对应权限。
+原生 IPC 只开放给打包的本地页面和配置的网站来源,协议、主机名和端口都要一致,登录跳转和其他来源不会获得原生权限,打包时使用网站最终打开的网址,包括 `www` 或工作区子域。在其他来源的页面上,原生通知、缩放、Pake 的全屏控制、隐藏标题栏时拖动窗口和通过系统浏览器打开链接不可用,下载会交给网页浏览器处理,跨域图片等资源可能直接显示而不保存。自定义命令需要同时注册到 `generate_handler!` 和 `src-tauri/build.rs` 的命令清单,并在 `src-tauri/capabilities/default.json` 中添加对应权限。
**网页端(JavaScript):**
@@ -154,8 +154,8 @@ macOS 会在首次使用时向用户弹出权限确认对话框。请仅在确
如果你需要为同一个站点生成多个彼此独立的应用,例如两个不同登录态的 Gmail,可以直接使用不同的应用名称进行构建:
```bash
-pake https://gmail.com --name "Gmail Work"
-pake https://gmail.com --name "Gmail Personal"
+pake https://mail.google.com --name "Gmail Work"
+pake https://mail.google.com --name "Gmail Personal"
```
Pake 现在会基于 `URL + name` 生成不同的应用标识,因此这两个应用会被当作两个独立桌面应用安装,而不是落到同一个应用上。
@@ -163,7 +163,7 @@ Pake 现在会基于 `URL + name` 生成不同的应用标识,因此这两个
对于需要固定 bundle identifier 的高级场景,Pake 也支持一个隐藏参数 `--identifier`:
```bash
-pake https://gmail.com --name "Gmail Work" --identifier com.example.gmail.work
+pake https://mail.google.com --name "Gmail Work" --identifier com.example.gmail.work
```
`--multi-instance` 和这个能力不同,它只是允许同一个已打包应用启动多个进程,并不会创建多个独立应用身份。