diff --git a/src/Facades/Window.php b/src/Facades/Window.php index 100da795..0c8b1f84 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -18,6 +18,8 @@ * @method static void maximize($id = null) * @method static void minimize($id = null) * @method static void zoomFactor(float $zoomFactor = 1.0) + * @method static void preventLeaveDomain(bool $preventLeaveDomain = true) + * @method static void preventLeavePage(bool $preventLeavePage = true): self * @method static void suppressNewWindows() */ class Window extends Facade diff --git a/src/Windows/Window.php b/src/Windows/Window.php index f8545811..a35fb262 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -70,6 +70,10 @@ class Window protected float $zoomFactor = 1.0; + protected bool $preventLeaveDomain = false; + + protected bool $preventLeavePage = false; + protected bool $suppressNewWindows = false; public function __construct(string $id) @@ -344,6 +348,20 @@ public function zoomFactor(float $zoomFactor = 1.0): self return $this; } + public function preventLeaveDomain(bool $preventLeaveDomain = true): self + { + $this->preventLeaveDomain = $preventLeaveDomain; + + return $this; + } + + public function preventLeavePage(bool $preventLeavePage = true): self + { + $this->preventLeavePage = $preventLeavePage; + + return $this; + } + public function suppressNewWindows(): self { $this->suppressNewWindows = true; @@ -390,6 +408,8 @@ public function toArray() 'transparent' => $this->transparent, 'webPreferences' => $this->webPreferences, 'zoomFactor' => $this->zoomFactor, + 'preventLeaveDomain' => $this->preventLeaveDomain, + 'preventLeavePage' => $this->preventLeavePage, 'suppressNewWindows' => $this->suppressNewWindows, ]; }