Skip to content

Commit 8cb4d8c

Browse files
authored
fix: firefoxPreview option should be set to mv3 only when explicitly requested (#2454)
1 parent 7f2346a commit 8cb4d8c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/program.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ export class Program {
221221
throw new UsageError('Not enough arguments following: start-url');
222222
}
223223

224+
if (Array.isArray(argv.firefoxPreview) && !argv.firefoxPreview.length) {
225+
argv.firefoxPreview = ['mv3'];
226+
}
227+
224228
return argv;
225229
}
226230

@@ -692,9 +696,9 @@ Example: $0 --help run.
692696
type: 'array',
693697
},
694698
'firefox-preview': {
695-
describe: 'Turn on developer preview features in Firefox',
699+
describe: 'Turn on developer preview features in Firefox' +
700+
' (defaults to "mv3")',
696701
demandOption: false,
697-
default: ['mv3'],
698702
type: 'array',
699703
},
700704
// Firefox for Android CLI options.

tests/unit/test.program.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,18 @@ describe('program.main', () => {
922922
const {firefoxPreview} = fakeCommands.run.firstCall.args[0];
923923
assert.deepEqual(firefoxPreview, ['mv3']);
924924
});
925+
926+
it('does not set any firefox preview prefs by default', async () => {
927+
const fakeCommands = fake(commands, {
928+
run: () => Promise.resolve(),
929+
});
930+
931+
await execProgram(['run'], {commands: fakeCommands});
932+
933+
const {firefoxPreview} = fakeCommands.run.firstCall.args[0];
934+
assert.deepEqual(firefoxPreview, undefined);
935+
});
936+
925937
});
926938

927939
describe('program.defaultVersionGetter', () => {

0 commit comments

Comments
 (0)