Skip to content

Commit 475ae18

Browse files
committed
Add documentation for suppressNewWindows method
1 parent cf1886d commit 475ae18

File tree

1 file changed

+13
-0
lines changed
  • resources/views/docs/desktop/1/the-basics

1 file changed

+13
-0
lines changed

resources/views/docs/desktop/1/the-basics/windows.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,19 @@ Window::open()
394394

395395
This is particularly useful for always-on-top utility windows or menubar applications that should not be visible in Mission Control.
396396

397+
#### Preventing new windows from popping up
398+
399+
By default, Electron allows additional windows to be opened from a window that was previously opened programmatically.
400+
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.
401+
This behaviour is potentially undesirable in a desktop application, as it enables the user to `break out` of a window.
402+
403+
To prevent additional windows from opening, you can apply the `suppressNewWindows()` method when opening a new window.
404+
405+
```php
406+
Window::open()
407+
->suppressNewWindows();
408+
```
409+
397410
## Window Title Styles
398411

399412
### Default Title Style

0 commit comments

Comments
 (0)