From c67fd915b5a7e74f1efe8499251b13d2aef3e778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= Date: Wed, 13 Aug 2025 19:59:34 +0200 Subject: [PATCH 1/2] Add a `zoomFactor` window option This commit allows to define a zoom factor for new and existing windows. The zoom factor is the zoom percent divided by 100, so 150% = 1.5. --- src/Windows/Window.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 92af58b5..245ae0bc 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -68,6 +68,8 @@ class Window protected array $webPreferences = []; + protected float $zoomFactor = 1.0; + public function __construct(string $id) { $this->id = $id; @@ -326,6 +328,20 @@ public function webPreferences(array $preferences): static return $this; } + public function zoomFactor(float $zoomFactor = 1.0): self + { + $this->zoomFactor = $zoomFactor; + + if (! $this instanceof PendingOpenWindow) { + $this->client->post('window/set-zoom-factor', [ + 'id' => $this->id, + 'zoomFactor' => $zoomFactor, + ]); + } + + return $this; + } + public function toArray() { return [ @@ -364,6 +380,7 @@ public function toArray() 'autoHideMenuBar' => $this->autoHideMenuBar, 'transparent' => $this->transparent, 'webPreferences' => $this->webPreferences, + 'zoomFactor' => $this->zoomFactor, ]; } From 602e8d242e03222cb30f68c268a6aef892d4d109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= Date: Sat, 16 Aug 2025 09:08:00 +0200 Subject: [PATCH 2/2] Add phpdoc for zoom factor --- src/Facades/Window.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Facades/Window.php b/src/Facades/Window.php index f73e2164..1f4aba82 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -17,6 +17,7 @@ * @method static void reload($id = null) * @method static void maximize($id = null) * @method static void minimize($id = null) + * @method static void zoomFactor(float $zoomFactor = 1.0) */ class Window extends Facade {