Add defaultX/defaultY options for setting default position of window #67
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 adds following options:
defaultX
: The X position that should be returned if no file exists yet. Defaults to0
.defaultY
: The Y position that should be returned if no file exists yet. Defaults to0
.Motivation of these options are that I want to specify default position of the window. This library specifies
x: 0, y: 0
as default position, but default position of browser window is not(0, 0)
. The default position is center of screen.These options accepts
undefined
becausex
andy
options inBrowserWindow
's constructor acceptsundefined
. When they are set toundefined
, the window is aligned at center of the screen.Note that this PR does not break current behavior because their default values are
0
. I added test case for this and updated type definitions also.