Skip to content

Commit 1c120f9

Browse files
authored
Add method to prevent sub-windows from opening (#685)
1 parent b2bddfe commit 1c120f9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Facades/Window.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @method static void maximize($id = null)
1919
* @method static void minimize($id = null)
2020
* @method static void zoomFactor(float $zoomFactor = 1.0)
21+
* @method static void suppressNewWindows()
2122
*/
2223
class Window extends Facade
2324
{

src/Windows/Window.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class Window
7070

7171
protected float $zoomFactor = 1.0;
7272

73+
protected bool $suppressNewWindows = false;
74+
7375
public function __construct(string $id)
7476
{
7577
$this->id = $id;
@@ -342,6 +344,13 @@ public function zoomFactor(float $zoomFactor = 1.0): self
342344
return $this;
343345
}
344346

347+
public function suppressNewWindows(): self
348+
{
349+
$this->suppressNewWindows = true;
350+
351+
return $this;
352+
}
353+
345354
public function toArray()
346355
{
347356
return [
@@ -381,6 +390,7 @@ public function toArray()
381390
'transparent' => $this->transparent,
382391
'webPreferences' => $this->webPreferences,
383392
'zoomFactor' => $this->zoomFactor,
393+
'suppressNewWindows' => $this->suppressNewWindows,
384394
];
385395
}
386396

0 commit comments

Comments
 (0)