ElectronNET / ElectronNET/Electron.NET

Prevent opening new windows

Offen
#672 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Feature
Vorherrschende Sprache
C#
Sterne
7.6k
Forks
741
Ø Merge
3 Std. 50 Min.
Gemergte PRs (30 T.)
2

Beschreibung

There is electrons ["new-window"](https://github.com/electron/electron/blob/main/docs/api/web-contents.md#event-new-window-deprecated) event. But i can not call `event.preventDefault()` in C# code (event `browserWindow.OnNewWindowForTab`). How am i be able to prevent opening new windows of my application? (for example when the user middle-mouse-clicks a link)

However, it is marked deprecated in the documentation in favor of [this function on the webContents class](https://github.com/electron/electron/blob/main/docs/api/web-contents.md#contentssetwindowopenhandlerhandler). So how can i access that? There are plenty of methods that are not implemented in Electron.Net.

Related to #434

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.