From e9f08bddba40bdcde491bba7f8cc50f0623fd5f1 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 10 Sep 2025 10:21:12 +0200 Subject: [PATCH 1/2] add configurable webpreferences --- src/MenuBar/MenuBar.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MenuBar/MenuBar.php b/src/MenuBar/MenuBar.php index c3b6ce8a..26354afd 100644 --- a/src/MenuBar/MenuBar.php +++ b/src/MenuBar/MenuBar.php @@ -34,6 +34,8 @@ class MenuBar protected bool $showOnAllWorkspaces = false; + protected array $webPreferences = []; + protected Client $client; public function __construct() @@ -111,6 +113,13 @@ public function withContextMenu(Menu $menu): self return $this; } + public function webPreferences(array $preferences): static + { + $this->webPreferences = $preferences; + + return $this; + } + public function toArray(): array { return [ @@ -132,6 +141,7 @@ public function toArray(): array 'contextMenu' => ! is_null($this->contextMenu) ? $this->contextMenu->toArray()['submenu'] : null, 'alwaysOnTop' => $this->alwaysOnTop, 'showOnAllWorkspaces' => $this->showOnAllWorkspaces, + 'webPreferences' => $this->webPreferences, ]; } } From 60dc3c6fccc03f280441f0eb4fd542a544ffcb8c Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 10 Sep 2025 10:22:00 +0200 Subject: [PATCH 2/2] add webPreferences phpdoc --- src/Facades/MenuBar.php | 1 + src/Facades/Window.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Facades/MenuBar.php b/src/Facades/MenuBar.php index b1d4972c..f11d60eb 100644 --- a/src/Facades/MenuBar.php +++ b/src/Facades/MenuBar.php @@ -14,6 +14,7 @@ * @method static void icon(string $icon) * @method static void resize(int $width, int $height) * @method static void contextMenu(Menu $contextMenu) + * @method static void webPreferences(array $preferences) */ class MenuBar extends Facade { diff --git a/src/Facades/Window.php b/src/Facades/Window.php index 0c8b1f84..5e44792d 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -21,6 +21,7 @@ * @method static void preventLeaveDomain(bool $preventLeaveDomain = true) * @method static void preventLeavePage(bool $preventLeavePage = true): self * @method static void suppressNewWindows() + * @method static void webPreferences(array $preferences) */ class Window extends Facade {