Implement dialog (alert/confirm) blocking as a user switch after the first dialog

* This is to enable more browser-like behavior so that users who run third-party code
  will not be DOS'ed with alerts and confirms.  This is already handled like this
  in most major browsers so this will greatly help these developers
This commit is contained in:
Samuel Attard 2018-01-10 17:07:56 +11:00 committed by Cheng Zhao
parent a3d4d461a3
commit 795447f61a
7 changed files with 47 additions and 43 deletions

View file

@ -362,6 +362,10 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `additionArguments` String[] (optional) - A list of strings that will be appended
to `process.argv` in the renderer process of this app. Useful for passing small
bits of data down to renderer process preload scripts.
* `safeDialogs` Boolean (optional) - Whether to enable browser style
consecutive dialog protection.
* `safeDialogsMessage` String (optional) - The message to display when consecutive
dialog protection is triggered.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from