Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include which browser args/preferences/trace configuration where used… #2259

Merged
merged 8 commits into from
Jan 25, 2025
Merged
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
41 changes: 40 additions & 1 deletion lib/core/engine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
addConnectivity,
removeConnectivity
} from '../../connectivity/index.js';
import { logResultLogLine, getProperty } from '../../support/util.js';
import { logResultLogLine, getProperty, toArray } from '../../support/util.js';
import {
getFullyLoaded,
getMainDocumentTimings,
Expand All @@ -30,6 +30,8 @@ import {
loadPageCompleteScript
} from '../../support/engineUtils.js';
import { getAvailablePort } from '../../support/getPort.js';
import { traceCategories as defaultChromeTraceCategories } from '../../chrome/settings/traceCategories.js';

const log = getLogger('browsertime');
const defaults = {
scripts: [],
Expand Down Expand Up @@ -369,6 +371,43 @@ export class Engine {
for (let result of totalResult) {
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;
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;
}
if (
options.chrome &&
(options.cpu || options.chrome.timeline || options.chrome.trace)
) {
// get correct trace categories
let chromeTraceCategories = options.chrome.traceCategories
? options.chrome.traceCategories.split(',')
: [...defaultChromeTraceCategories];

if (options.chrome.enableTraceScreenshots) {
chromeTraceCategories.push(
'disabled-by-default-devtools.screenshot'
);
}

if (options.chrome && options.chrome.traceCategory) {
const extraCategories = toArray(options.chrome.traceCategory);
Array.prototype.push.apply(
chromeTraceCategories,
extraCategories
);
}

result.info.browser.traceCategories = chromeTraceCategories;
}
}
}
} else if (options.browser === 'safari') {
for (let result of totalResult) {
Expand Down
Loading