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.

chore: bump version to 3.8.3 in package.json, Cargo.toml, and Cargo.lock; enhance zoom functionality for Windows

tw939435bb916b6c
diff --git a/package.json b/package.json
index fae31c91..3ed0e424 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "pake-cli",
- "version": "3.8.2",
+ "version": "3.8.3",
"description": "🤱🏻 Turn any webpage into a desktop app with one command. 🤱🏻 一键打包网页生成轻量桌面应用。",
"engines": {
"node": ">=18.0.0"
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 5585c4b8..4326249a 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -2526,7 +2526,7 @@ dependencies = [
[[package]]
name = "pake"
-version = "3.8.2"
+version = "3.8.3"
dependencies = [
"serde",
"serde_json",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 7c21cb47..37b6ecc5 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pake"
-version = "3.8.2"
+version = "3.8.3"
description = "🤱🏻 Turn any webpage into a desktop app with Rust."
authors = ["Tw93"]
license = "MIT"
diff --git a/src-tauri/src/inject/event.js b/src-tauri/src/inject/event.js
index 6708298e..84e712e1 100644
--- a/src-tauri/src/inject/event.js
+++ b/src-tauri/src/inject/event.js
@@ -12,7 +12,19 @@ const shortcuts = {
function setZoom(zoom) {
const html = document.getElementsByTagName("html")[0];
- html.style.zoom = zoom;
+ const body = document.body;
+ const zoomValue = parseFloat(zoom) / 100;
+ const isWindows = /windows/i.test(navigator.userAgent);
+
+ if (isWindows) {
+ body.style.transform = `scale(${zoomValue})`;
+ body.style.transformOrigin = "top left";
+ body.style.width = `${100 / zoomValue}%`;
+ body.style.height = `${100 / zoomValue}%`;
+ } else {
+ html.style.zoom = zoom;
+ }
+
window.localStorage.setItem("htmlZoom", zoom);
}