Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Facades/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
class Window extends Facade
{
Expand Down
20 changes: 20 additions & 0 deletions src/Windows/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class Window

protected float $zoomFactor = 1.0;

protected bool $preventLeaveDomain = false;

protected bool $preventLeavePage = false;

public function __construct(string $id)
{
$this->id = $id;
Expand Down Expand Up @@ -342,6 +346,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 toArray()
{
return [
Expand Down Expand Up @@ -381,6 +399,8 @@ public function toArray()
'transparent' => $this->transparent,
'webPreferences' => $this->webPreferences,
'zoomFactor' => $this->zoomFactor,
'preventLeaveDomain' => $this->preventLeaveDomain,
'preventLeavePage' => $this->preventLeavePage,
];
}

Expand Down
Loading