@@ -29,7 +29,7 @@ const instances = new Set<Launcher>();
29
29
type JSONLike = | { [ property : string ] : JSONLike } | readonly JSONLike [ ] | string | number | boolean | null ;
30
30
31
31
export interface Options {
32
- startingUrl ?: string ;
32
+ startingUrl ?: string | Array < string > ;
33
33
chromeFlags ?: Array < string > ;
34
34
prefs ?: Record < string , JSONLike > ;
35
35
port ?: number ;
@@ -111,7 +111,7 @@ async function killAll(): Promise<Array<Error>> {
111
111
class Launcher {
112
112
private tmpDirandPidFileReady = false ;
113
113
private pidFile : string ;
114
- private startingUrl : string ;
114
+ private startingUrl : string | Array < string > ;
115
115
private outFile ?: number ;
116
116
private errFile ?: number ;
117
117
private chromePath ?: string ;
@@ -139,6 +139,7 @@ class Launcher {
139
139
140
140
// choose the first one (default)
141
141
this . startingUrl = defaults ( this . opts . startingUrl , 'about:blank' ) ;
142
+ this . startingUrl = typeof this . startingUrl === 'string' ? [ this . startingUrl ] : this . startingUrl ;
142
143
this . chromeFlags = defaults ( this . opts . chromeFlags , [ ] ) ;
143
144
this . prefs = defaults ( this . opts . prefs , { } ) ;
144
145
this . requestedPort = defaults ( this . opts . port , 0 ) ;
@@ -176,7 +177,7 @@ class Launcher {
176
177
}
177
178
178
179
flags . push ( ...this . chromeFlags ) ;
179
- flags . push ( this . startingUrl ) ;
180
+ flags . push ( ... this . startingUrl ) ;
180
181
181
182
return flags ;
182
183
}
0 commit comments