From 475ae18471e00ea1e0739a698441c54abadbf7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= Date: Fri, 22 Aug 2025 13:23:09 +0200 Subject: [PATCH 1/2] Add documentation for `suppressNewWindows` method --- .../views/docs/desktop/1/the-basics/windows.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/views/docs/desktop/1/the-basics/windows.md b/resources/views/docs/desktop/1/the-basics/windows.md index 5dc737ea..8c71071b 100644 --- a/resources/views/docs/desktop/1/the-basics/windows.md +++ b/resources/views/docs/desktop/1/the-basics/windows.md @@ -394,6 +394,19 @@ Window::open() This is particularly useful for always-on-top utility windows or menubar applications that should not be visible in Mission Control. +#### Preventing new windows from popping up + +By default, Electron allows additional windows to be opened from a window that was previously opened programmatically. +This is the case, for example, with `a` elements that have the target attribute set to `_blank` or when the user clicks on a link with the middle mouse button. +This behaviour is potentially undesirable in a desktop application, as it enables the user to `break out` of a window. + +To prevent additional windows from opening, you can apply the `suppressNewWindows()` method when opening a new window. + +```php +Window::open() + ->suppressNewWindows(); +``` + ## Window Title Styles ### Default Title Style From 361a8af9e72b4a6fc2a9f9881a4d7beb91d74ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gl=C3=BCck?= Date: Fri, 22 Aug 2025 13:28:06 +0200 Subject: [PATCH 2/2] Fix formatting --- resources/views/docs/desktop/1/the-basics/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/docs/desktop/1/the-basics/windows.md b/resources/views/docs/desktop/1/the-basics/windows.md index 8c71071b..5f039144 100644 --- a/resources/views/docs/desktop/1/the-basics/windows.md +++ b/resources/views/docs/desktop/1/the-basics/windows.md @@ -398,7 +398,7 @@ This is particularly useful for always-on-top utility windows or menubar applica By default, Electron allows additional windows to be opened from a window that was previously opened programmatically. This is the case, for example, with `a` elements that have the target attribute set to `_blank` or when the user clicks on a link with the middle mouse button. -This behaviour is potentially undesirable in a desktop application, as it enables the user to `break out` of a window. +This behaviour is potentially undesirable in a desktop application, as it enables the user to "break out" of a window. To prevent additional windows from opening, you can apply the `suppressNewWindows()` method when opening a new window.