From 2058786419c0f5b0c2df0f369a8e9ffe3ca2bf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= Date: Fri, 22 Aug 2025 13:21:54 +0200 Subject: [PATCH] Add method to prevent sub-windows from opening --- src/Facades/Window.php | 1 + src/Windows/Window.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Facades/Window.php b/src/Facades/Window.php index 1f4aba82..100da795 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -18,6 +18,7 @@ * @method static void maximize($id = null) * @method static void minimize($id = null) * @method static void zoomFactor(float $zoomFactor = 1.0) + * @method static void suppressNewWindows() */ class Window extends Facade { diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 245ae0bc..f8545811 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -70,6 +70,8 @@ class Window protected float $zoomFactor = 1.0; + protected bool $suppressNewWindows = false; + public function __construct(string $id) { $this->id = $id; @@ -342,6 +344,13 @@ public function zoomFactor(float $zoomFactor = 1.0): self return $this; } + public function suppressNewWindows(): self + { + $this->suppressNewWindows = true; + + return $this; + } + public function toArray() { return [ @@ -381,6 +390,7 @@ public function toArray() 'transparent' => $this->transparent, 'webPreferences' => $this->webPreferences, 'zoomFactor' => $this->zoomFactor, + 'suppressNewWindows' => $this->suppressNewWindows, ]; }