You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/views/docs/desktop/1/the-basics/windows.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -394,6 +394,19 @@ Window::open()
394
394
395
395
This is particularly useful for always-on-top utility windows or menubar applications that should not be visible in Mission Control.
396
396
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
+
397
410
### Zoom factor
398
411
399
412
In certain cases, you may want to set a zoom factor for a window.
0 commit comments