diff --git a/resources/views/docs/desktop/1/the-basics/windows.md b/resources/views/docs/desktop/1/the-basics/windows.md index 5dc737ea..5f039144 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