@@ -153,6 +153,7 @@ export type CmdRunParams = {
153153 noReload : boolean ,
154154 browserConsole : boolean ,
155155 customPrefs ?: FirefoxPreferences ,
156+ startUrl ?: string | Array < string > ,
156157} ;
157158
158159export type CmdRunOptions = {
@@ -165,7 +166,7 @@ export default async function run(
165166 {
166167 sourceDir, artifactsDir, firefox, firefoxProfile,
167168 preInstall = false , noReload = false ,
168- browserConsole = false , customPrefs,
169+ browserConsole = false , customPrefs, startUrl ,
169170 } : CmdRunParams ,
170171 {
171172 firefoxApp = defaultFirefoxApp ,
@@ -197,6 +198,7 @@ export default async function run(
197198 manifestData,
198199 profilePath : firefoxProfile ,
199200 customPrefs,
201+ startUrl,
200202 } ) ;
201203
202204 const profile = await runner . getProfile ( ) ;
@@ -269,6 +271,7 @@ export type ExtensionRunnerParams = {
269271 firefox : string ,
270272 browserConsole : boolean ,
271273 customPrefs ?: FirefoxPreferences ,
274+ startUrl ?: string | Array < string > ,
272275} ;
273276
274277export class ExtensionRunner {
@@ -279,11 +282,12 @@ export class ExtensionRunner {
279282 firefox: string ;
280283 browserConsole: boolean ;
281284 customPrefs: FirefoxPreferences ;
285+ startUrl: ?string | ?Array < string > ;
282286
283287 constructor (
284288 {
285289 firefoxApp, sourceDir, manifestData,
286- profilePath, firefox, browserConsole,
290+ profilePath, firefox, browserConsole, startUrl ,
287291 customPrefs = { } ,
288292 } : ExtensionRunnerParams
289293 ) {
@@ -294,6 +298,7 @@ export class ExtensionRunner {
294298 this . firefox = firefox ;
295299 this . browserConsole = browserConsole ;
296300 this . customPrefs = customPrefs ;
301+ this . startUrl = startUrl ;
297302 }
298303
299304 getProfile ( ) : Promise < FirefoxProfile > {
@@ -329,12 +334,18 @@ export class ExtensionRunner {
329334
330335 run ( profile : FirefoxProfile ) : Promise < FirefoxProcess > {
331336 const binaryArgs = [ ] ;
332- const { firefoxApp, firefox} = this ;
337+ const { firefoxApp, firefox, startUrl } = this ;
333338 if ( this . browserConsole ) {
334339 binaryArgs . push ( '-jsconsole' ) ;
335340 }
336- return firefoxApp . run (
337- profile , { firefoxBinary : firefox , binaryArgs}
338- ) ;
341+ if ( startUrl ) {
342+ const urls = Array . isArray ( startUrl ) ? startUrl : [ startUrl ] ;
343+ for ( const url of urls ) {
344+ binaryArgs . push ( '--url' , url ) ;
345+ }
346+ }
347+ return firefoxApp . run ( profile , {
348+ firefoxBinary : firefox , binaryArgs,
349+ } ) ;
339350 }
340351}
0 commit comments