Skip to content

Commit ed5be42

Browse files
authored
fix: Fix options passing for open() (#4)
* Fix options for open() * Fixed arguments passing
1 parent e1dc055 commit ed5be42

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,13 @@ function startBrowserProcess(browser, url, args) {
145145
browser = undefined;
146146
}
147147

148-
// If there are arguments, they must be passed as array with the browser
149-
if (typeof browser === 'string' && args.length > 0) {
150-
browser = [browser].concat(args);
151-
}
152-
153148
// Fallback to open
154149
// (It will always open new tab)
155150
try {
156-
var options = { app: browser, wait: false, url: true };
151+
var options = { app: {
152+
name: browser,
153+
arguments: typeof browser === 'string' && args.length > 0 ? args : []
154+
}, wait: false, url: true };
157155
open(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
158156
return true;
159157
} catch (err) {

0 commit comments

Comments
 (0)