Allow optional suppression of opening sub-windows #685
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows developers to disable the opening of potentially unwanted pop-up windows.
By default, Electron doesn't prevent sub-windows to be opened out of a window. This would for instance be the case if a user middle-clicks a link. 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, this PR adds a
suppressNewWindows()
method that can be applied when opening a new window. It will prevent any pop-up windows being opened.Electron PR: NativePHP/electron#249
Docs PR: NativePHP/nativephp.com#200
If there's anything you'd like me to tweak or improve in this PR, please let me know. 😊