diff --git a/bin/README.md b/bin/README.md index deace75..68ecd5b 100644 --- a/bin/README.md +++ b/bin/README.md @@ -52,12 +52,11 @@ export const DEFAULT_DEV_PAKE_OPTIONS: PakeCliOptions & {url: string} = { then - ```bash yarn cli:dev ``` -The script will reads the above configuration and packages the specified `app` using `watch` mode, and changes to the `pake-cli` code and `pake` are hot updated in real time. +The script will read the above configuration and packages the specified `app` using `watch` mode, and changes to the `pake-cli` code and `pake` are hot updated in real time. ### CLI Usage @@ -121,19 +120,29 @@ Enable or disable immersive header. Default is `false`. Use the following comman --transparent ``` +#### [fullscreen] + +Determine whether the application launches in full screen. Default is `false`. Use the following command to enable full +screen. + +```shell +--fullscreen +``` + #### [always-on-top] -Enable the always-on-top feature. Default is `false`. + +Sets whether the window is always at the top level, defaults to `false`. ```shell --always-on-top ``` -#### [fullscreen] +#### [disabled-web-shortcuts] -Determine whether the application launches in full screen. Default is `false`. Use the following command to enable full screen. +Sets whether to disable web shortcuts in the original Pake container, defaults to `false`. ```shell ---fullscreen +--disabled-web-shortcuts ``` #### [multi-arch] @@ -202,6 +211,7 @@ Enable recursive copying. When the URL is a local file path, enabling this optio ``` #### [inject] + Using `inject`, you can inject local absolute and relative path `css` and `js` files into the page you specify the `url` to customize it. For example, an adblock script that can be applied to any web page, or a `css` that optimizes the `UI` of a page, you can write it once to customize it. would only need to write the `app` once to generalize it to any other page. ```shell @@ -209,15 +219,23 @@ Using `inject`, you can inject local absolute and relative path `css` and `js` f ``` #### [safe-domain] + This secure domain is a domain other than your currently configured `url` to which you may be redirected or jumped to, and only in domains that have been configured as secure can you use `tauri` to expose `api` to browsers to ensure that pake's built-in enhancements work correctly. Only in a domain that has been configured as secure can you use the `tauri` to expose the `api` to the browser, ensuring that `pake's` built-in enhancements work correctly. PS: Secure domains do not need to carry protocols. - ```shell --safe-domain weread.qq.com,google.com ``` +#### [debug] + +The typed package has dev-tools for debugging, in addition to outputting more log messages for debugging. + +```shell +--debug +``` + ## Conclusion After completing the above steps, your application should be successfully packaged. Please note that the packaging process may take some time depending on your system configuration and network conditions. Be patient, and once the packaging is complete, you can find the application installer in the specified directory. diff --git a/bin/README_CN.md b/bin/README_CN.md index 981a255..d5b9868 100644 --- a/bin/README_CN.md +++ b/bin/README_CN.md @@ -40,6 +40,7 @@ npm install pake-cli -g ## 使用方法 ### 开发 + 开发时可以修改 `bin/defaults.ts` 中 `DEFAULT_DEV_PAKE_OPTIONS` 配置,配置项和 `pake-cli` 配置说明保持一致 ```typescript @@ -58,7 +59,6 @@ yarn cli:dev 脚本会读取上述配置并使用 `watch` 模式打包指定的 `app`,对 `pake-cli` 代码和 `pake` 的修改都会实时热更新。 - ### 使用 CLI ```bash @@ -122,16 +122,6 @@ pake [url] [options] --transparent ``` -#### [always-on-top] -设置是否窗口一直在最顶层,默认为 `false`。 - -```shell ---always-on-top -``` - - -```shell - #### [fullscreen] 设置应用程序是否在启动时自动全屏,默认为 `false`。使用以下命令可以设置应用程序启动时自动全屏。 @@ -140,6 +130,22 @@ pake [url] [options] --fullscreen ``` +#### [always-on-top] + +设置是否窗口一直在最顶层,默认为 `false`。 + +```shell +--always-on-top +``` + +#### [disabled-web-shortcuts] + +设置是否禁用原有 Pake 容器里面的网页操作快捷键,默认为 `false`。 + +```shell +--disabled-web-shortcuts +``` + #### [multi-arch] 设置打包结果同时支持 Intel 和 M1 芯片,仅适用于 macOS,默认为 `false`。 @@ -232,6 +238,14 @@ PS: 安全域名不需要携带协议。 --safe-domain weread.qq.com,google.com ``` +#### [debug] + +打出来的包具备 deb-tools 的调试模式,此外还会输出更多的日志信息用于调试。 + +```shell +--debug +``` + ## 结语 完成上述步骤后,您的应用程序应该已经成功打包。请注意,根据您的系统配置和网络状况,打包过程可能需要一些时间。请耐心等待,一旦打包完成,您就可以在指定的目录中找到应用程序安装包。 diff --git a/bin/defaults.ts b/bin/defaults.ts index cfaff8b..b75c4c7 100644 --- a/bin/defaults.ts +++ b/bin/defaults.ts @@ -8,6 +8,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = { resizable: true, transparent: false, alwaysOnTop: false, + disabledWebShortcuts: false, userAgent: '', showSystemTray: false, multiArch: false, diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts index 9d306e6..820a688 100644 --- a/bin/helpers/merge.ts +++ b/bin/helpers/merge.ts @@ -14,6 +14,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon fullscreen, transparent, alwaysOnTop, + disabledWebShortcuts, userAgent, showSystemTray, systemTrayIcon, @@ -34,6 +35,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon fullscreen, transparent, alwaysOnTop, + disabledWebShortcuts, resizable, }; Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions }); @@ -193,7 +195,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon logger.error('The injected file must be in either CSS or JS format.'); return; } - const files = inject.map(filepath => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)); + const files = inject.map(filepath => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)); tauriConf.pake.inject = files; await combineFiles(files, injectFilePath); } else { diff --git a/bin/types.ts b/bin/types.ts index f555ed4..da11231 100644 --- a/bin/types.ts +++ b/bin/types.ts @@ -27,6 +27,9 @@ export interface PakeCliOptions { // Enable windows always on top, default false alwaysOnTop: boolean; + // Disable web shortcuts, default false + disabledWebShortcuts: boolean; + // Custom User-Agent, default off userAgent: string;