add constructor options of openDevTools to nightmare.js

This commit is contained in:
noppoman
2017-11-24 14:53:59 +09:00
parent 3289762cca
commit dd5f686f91
2 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for Nightmare 1.6.6
// Type definitions for Nightmare 2.10.0
// Project: https://github.com/segmentio/nightmare
// Definitions by: horiuchi <https://github.com/horiuchi>
// Sam Yang <https://github.com/samyang-au>
@@ -147,6 +147,13 @@ declare namespace Nightmare {
typeInterval?: number;
x?: number;
y?: number;
openDevTools?: {
/**
* Opens the devtools with specified dock state, can be right, bottom, undocked, detach.
* https://github.com/electron/electron/blob/master/docs/api/web-contents.md#contentsopendevtoolsoptions
*/
mode?: string;
};
}
export interface IRequest {

View File

@@ -364,4 +364,6 @@ new Nightmare()
new Nightmare()
.goto('https://github.com/segmentio/nightmare')
.click('a[href="/segmentio/nightmare/archive/master.zip"]')
.download('/some/other/path/master.zip');
.download('/some/other/path/master.zip');
new Nightmare({show: true, openDevTools: {mode: 'detach'}});