File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export type CmdRunParams = {|
43
43
startUrl ?: Array < string > ,
44
44
target ?: Array < string > ,
45
45
args ?: Array < string > ,
46
+ firefoxPreview : Array < string > ,
46
47
47
48
// Android CLI options.
48
49
adbBin ? : string ,
@@ -89,6 +90,7 @@ export default async function run(
89
90
startUrl,
90
91
target,
91
92
args,
93
+ firefoxPreview = [ ] ,
92
94
// Android CLI options.
93
95
adbBin,
94
96
adbHost,
@@ -126,7 +128,12 @@ export default async function run(
126
128
127
129
// Create an alias for --pref since it has been transformed into an
128
130
// object containing one or more preferences.
129
- const customPrefs = pref ;
131
+ const customPrefs : FirefoxPreferences = { ...pref } ;
132
+ if ( firefoxPreview . includes ( 'mv3' ) ) {
133
+ log . info ( 'Configuring Firefox preferences for Manifest V3' ) ;
134
+ customPrefs [ 'extensions.manifestV3.enabled' ] = true ;
135
+ }
136
+
130
137
const manifestData = await getValidatedManifest ( sourceDir ) ;
131
138
132
139
const profileDir = firefoxProfile || chromiumProfile ;
Original file line number Diff line number Diff line change @@ -691,6 +691,12 @@ Example: $0 --help run.
691
691
demandOption : false ,
692
692
type : 'array' ,
693
693
} ,
694
+ 'firefox-preview' : {
695
+ describe : 'Turn on developer preview features in Firefox' ,
696
+ demandOption : false ,
697
+ default : [ 'mv3' ] ,
698
+ type : 'array' ,
699
+ } ,
694
700
// Firefox for Android CLI options.
695
701
'adb-bin' : {
696
702
describe : 'Specify a custom path to the adb binary' ,
Original file line number Diff line number Diff line change @@ -454,4 +454,22 @@ describe('run', () => {
454
454
) ;
455
455
} ) ;
456
456
} ) ;
457
+
458
+ describe ( 'firefox-preview' , ( ) => {
459
+ it ( 'supports the MV3 preview' , async ( ) => {
460
+ const cmd = await prepareRun ( ) ;
461
+ const runOptions = {
462
+ firefoxPreview : [ 'mv3' ] ,
463
+ } ;
464
+
465
+ await cmd . run ( runOptions ) ;
466
+
467
+ sinon . assert . calledOnce ( desktopRunnerStub ) ;
468
+ const runnerParams = desktopRunnerStub . firstCall . args [ 0 ] ;
469
+
470
+ assert . deepEqual ( runnerParams . customPrefs , {
471
+ 'extensions.manifestV3.enabled' : true ,
472
+ } ) ;
473
+ } ) ;
474
+ } ) ;
457
475
} ) ;
Original file line number Diff line number Diff line change @@ -912,6 +912,16 @@ describe('program.main', () => {
912
912
}
913
913
} ) ;
914
914
915
+ it ( 'sets the default firefox preview to "mv3"' , async ( ) => {
916
+ const fakeCommands = fake ( commands , {
917
+ run : ( ) => Promise . resolve ( ) ,
918
+ } ) ;
919
+
920
+ await execProgram ( [ 'run' , '--firefox-preview' ] , { commands : fakeCommands } ) ;
921
+
922
+ const { firefoxPreview} = fakeCommands . run . firstCall . args [ 0 ] ;
923
+ assert . deepEqual ( firefoxPreview , [ 'mv3' ] ) ;
924
+ } ) ;
915
925
} ) ;
916
926
917
927
describe ( 'program.defaultVersionGetter' , ( ) => {
You can’t perform that action at this time.
0 commit comments