Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions lib/core/engine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,34 @@ export class Engine {
result.info.browser.name = extras.har.log.browser.name;
result.info.browser.version = extras.har.log.browser.version;
if (options.browser === 'firefox' && options.firefox) {
result.info.browser.args = options.firefox.args;
// Issue #1622 — surface the full set of args/preferences/binary
// that browsertime applied to Firefox, not just what the user
// passed via --firefox.args / --firefox.preference. Captured by
// configureBuilder; see lib/firefox/webdriver/builder.js.
if (options.recordedBrowserSettings) {
const recorded = options.recordedBrowserSettings;
result.info.browser.args = recorded.args;
result.info.browser.preferences = recorded.preferences;
if (recorded.binary) {
result.info.browser.binary = recorded.binary;
}
if (recorded.profile) {
result.info.browser.profile = recorded.profile;
}
if (recorded.androidPackage) {
result.info.browser.androidPackage = recorded.androidPackage;
}
if (recorded.androidActivity) {
result.info.browser.androidActivity = recorded.androidActivity;
}
} else {
result.info.browser.args = options.firefox.args;
result.info.browser.preference = options.firefox.preference;
}
if (options.firefox.geckoProfiler === true) {
result.info.browser.geckProfilerFeatures =
options.firefox.geckoProfilerParams.features;
}
result.info.browser.preference = options.firefox.preference;
} else if (options.browser === 'chrome') {
if (options.chrome) {
result.info.browser.args = options.chrome.args;
Expand Down
8 changes: 8 additions & 0 deletions lib/core/engine/iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ export class Iteration {

await engineDelegate.beforeBrowserStart();
await browser.start();
// The runner deep-merges options into a fresh object before passing them
// to the browser-specific builder, so anything the builder records there
// never reaches the engine. Copy it back to the engine's options object
// so result.info.browser can pick it up. Issue #1622.
if (browser.options && browser.options.recordedBrowserSettings) {
this.options.recordedBrowserSettings =
browser.options.recordedBrowserSettings;
}
await engineDelegate.afterBrowserStart(browser);
}

Expand Down
14 changes: 14 additions & 0 deletions lib/firefox/webdriver/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,18 @@ export async function configureBuilder(builder, baseDir, options) {
}

builder.setFirefoxOptions(ffOptions);

// Snapshot every argument / preference / capability we just applied so it
// can be surfaced in the result JSON for debugging — issue #1622. The
// runner deep-merges options into a fresh container before this is called,
// so iteration.js threads it back to the engine after browser.start().
const ffInternals = ffOptions.firefoxOptions_();
options.recordedBrowserSettings = {
args: [...(ffInternals.args || [])],
preferences: { ...ffInternals.prefs },
binary: ffInternals.binary,
profile: ffInternals.profile,
androidPackage: ffInternals.androidPackage,
androidActivity: ffInternals.androidActivity
};
}
Loading