Skip to content

Commit

Permalink
fix: pass app object to open instead of string/array (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah authored Jan 21, 2022
1 parent 2594401 commit 0535875
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ const startBrowserProcess = (browser, url, opts = {}, args = []) => {
browser = undefined;
}

// If there are arguments, they must be passed as array with the browser
if (typeof browser === 'string' && args.length > 0) {
browser = [browser].concat(args);
}

// Fallback to opn
// (It will always open new tab)
const options = {app: browser, url: true, wait: false, ...opts};
const options = {
app: {name: browser, arguments: args},
wait: false,
...opts,
};
return require('open')(url, options);
};

Expand Down

0 comments on commit 0535875

Please sign in to comment.