diff --git a/index.js b/index.js index 3daa162..e2bbc05 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,7 @@ module.exports = async (target, options) => { options = { wait: false, + background: false, ...options }; @@ -40,6 +41,10 @@ module.exports = async (target, options) => { cliArguments.push('-W'); } + if (options.background) { + cliArguments.push('--background'); + } + if (options.app) { cliArguments.push('-a', options.app); } diff --git a/readme.md b/readme.md index 160b743..1b38ec1 100644 --- a/readme.md +++ b/readme.md @@ -76,6 +76,13 @@ Note that it waits for the app to exit, not just for the window to close. On Windows, you have to explicitly specify an app for it to be able to wait. +##### background (macOS only) + +Type: `boolean`
+Default: `false` + +Do not bring the app to the foreground. + ##### app Type: `string | string[]`