Skip to content
Permalink
Browse files

Implement dock option

The dock icon is now hidden by default by the following pull request:
#426

This OS X specific option allows the dock icon to be shown again, mainly
for testing purposes, and makes no harm in other operating systems.

Fixes: #377
  • Loading branch information...
Juan Cruz Viotti
Juan Cruz Viotti committed Jan 18, 2016
1 parent 88229e6 commit 84f8e4407f3e6a3e7638d1cecf369f5fe0b73c97
Showing with 12 additions and 1 deletion.
  1. +9 −0 Readme.md
  2. +2 −0 lib/nightmare.js
  3. +1 −1 lib/runner.js
@@ -138,6 +138,15 @@ var nightmare = Nightmare({
});
```

##### dock (OS X)
A boolean to optionally show the Electron icon in the dock (defaults to `false`). This is useful for testing purposes.

```js
var nightmare = Nightmare({
dock: true
});
```

#### .useragent(useragent)
Set the `useragent` used by electron.

@@ -62,6 +62,8 @@ function Nightmare(options) {
electronArgs.switches = options.switches;
}

electronArgs.dock = options.dock || false;

this.proc = proc.spawn(electron_path, [runner].concat(JSON.stringify(electronArgs)), {
stdio: [null, null, null, 'ipc']
});
@@ -46,7 +46,7 @@ if (process.argv.length > 2) {

// app.dock is not defined when running
// electron in a platform other than OS X
if (app.dock) {
if (!processArgs.dock && app.dock) {
app.dock.hide();
}

0 comments on commit 84f8e44

Please sign in to comment.
You can’t perform that action at this time.