From 6eb297bf1638a0d2df5cd6abfdf814b1737a5a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= <65236355+JulianGlueck@users.noreply.github.com> Date: Mon, 18 Aug 2025 12:25:15 +0200 Subject: [PATCH 1/6] Add support for setting zoom factor on windows (#678) --- src/Facades/Window.php | 1 + src/Windows/Window.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Facades/Window.php b/src/Facades/Window.php index f73e2164..1f4aba82 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -17,6 +17,7 @@ * @method static void reload($id = null) * @method static void maximize($id = null) * @method static void minimize($id = null) + * @method static void zoomFactor(float $zoomFactor = 1.0) */ class Window extends Facade { diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 92af58b5..245ae0bc 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -68,6 +68,8 @@ class Window protected array $webPreferences = []; + protected float $zoomFactor = 1.0; + public function __construct(string $id) { $this->id = $id; @@ -326,6 +328,20 @@ public function webPreferences(array $preferences): static return $this; } + public function zoomFactor(float $zoomFactor = 1.0): self + { + $this->zoomFactor = $zoomFactor; + + if (! $this instanceof PendingOpenWindow) { + $this->client->post('window/set-zoom-factor', [ + 'id' => $this->id, + 'zoomFactor' => $zoomFactor, + ]); + } + + return $this; + } + public function toArray() { return [ @@ -364,6 +380,7 @@ public function toArray() 'autoHideMenuBar' => $this->autoHideMenuBar, 'transparent' => $this->transparent, 'webPreferences' => $this->webPreferences, + 'zoomFactor' => $this->zoomFactor, ]; } From e4ec3decfb8bbc8b3bca13b74209233d5e84bcf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= <65236355+JulianGlueck@users.noreply.github.com> Date: Mon, 18 Aug 2025 12:30:54 +0200 Subject: [PATCH 2/6] Add methods to `App` to retrieve locale information (#681) --- src/App.php | 15 +++++++++++++++ src/Facades/App.php | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/App.php b/src/App.php index 8c06ad1c..0ebb54b8 100644 --- a/src/App.php +++ b/src/App.php @@ -34,6 +34,21 @@ public function isHidden(): bool return $this->client->get('app/is-hidden')->json('is_hidden'); } + public function getLocale(): string + { + return $this->client->get('app/locale')->json('locale'); + } + + public function getLocaleCountryCode(): string + { + return $this->client->get('app/locale-country-code')->json('locale_country_code'); + } + + public function getSystemLocale(): string + { + return $this->client->get('app/system-locale')->json('system_locale'); + } + public function version(): string { return $this->client->get('app/version')->json('version'); diff --git a/src/Facades/App.php b/src/Facades/App.php index 8754580e..6c0b8410 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -10,6 +10,9 @@ * @method static void focus() * @method static void hide() * @method static bool isHidden() + * @method static string getLocale() + * @method static string getLocaleCountryCode() + * @method static string getSystemLocale() * @method static string version() * @method static int badgeCount($count = null) * @method static void addRecentDocument(string $path) From 400478fa27e6c39b1e9e12c2be66309076404d8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 12:05:37 +0100 Subject: [PATCH 3/6] chore(deps): bump aglipanci/laravel-pint-action from 2.5 to 2.6 (#666) Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.5 to 2.6. - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases) - [Commits](https://github.com/aglipanci/laravel-pint-action/compare/2.5...2.6) --- updated-dependencies: - dependency-name: aglipanci/laravel-pint-action dependency-version: '2.6' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/fix-php-code-style-issues.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 7c6a4c2d..813eb452 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -26,14 +26,14 @@ jobs: - name: Check PHP code style issues if: github.event_name == 'push' - uses: aglipanci/laravel-pint-action@2.5 + uses: aglipanci/laravel-pint-action@2.6 with: verboseMode: true testMode: true - name: Fix PHP code style issues if: github.event_name == 'pull_request' - uses: aglipanci/laravel-pint-action@2.5 + uses: aglipanci/laravel-pint-action@2.6 - name: Commit changes if: github.event_name == 'pull_request' From b2bddfe1366c807c15b13c13d8f1e068b224ba07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 12:06:04 +0100 Subject: [PATCH 4/6] chore(deps): bump actions/checkout from 4 to 5 (#683) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/fix-php-code-style-issues.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/update-changelog.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 813eb452..33b9e59c 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ github.head_ref || github.sha }} diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 871c602f..c777c5cd 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 68e6ca9b..a6487696 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 859924d6..700d4809 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: main From 1c120f9c6812a1abee76c6244fc9abc768514466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= <65236355+JulianGlueck@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:33:22 +0200 Subject: [PATCH 5/6] Add method to prevent sub-windows from opening (#685) --- 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, ]; } From b2f7ce5df64629dd4c9a37f71572b58608d081ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= <65236355+JulianGlueck@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:46:04 +0200 Subject: [PATCH 6/6] Add possibility to prevent navigation away from current domain or page (#686) * Add possibility to prevent navigation away from current domain or page * add missing return after merge conflict --------- Co-authored-by: Willem Leuverink --- src/Facades/Window.php | 2 ++ src/Windows/Window.php | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) 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, ]; }