Skip to content

Commit 98d5cb6

Browse files
committed
proto: add ConfigSettings fields. thx #15193
1 parent 693a82a commit 98d5cb6

File tree

2 files changed

+120
-33
lines changed

2 files changed

+120
-33
lines changed

proto/lighthouse-result.proto

+119-32
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ message LighthouseResult {
128128
map<string, CategoryGroup> category_groups = 11;
129129

130130
// Message containing the configuration settings for the LH run
131-
// Next ID: 10
131+
// Next ID: 30
132132
message ConfigSettings {
133133
// The possible form factors an audit can be run in.
134134
// This enum served the emulated_form_factor field, but in v7, that field
@@ -189,20 +189,93 @@ message LighthouseResult {
189189
string throttling_method = 8;
190190

191191
message ScreenEmulation {
192-
// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
192+
// Overriding width value in pixels (minimum 0, maximum 10000000).
193+
// 0 disables the override.
193194
double width = 1;
194-
// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
195+
// Overriding height value in pixels (minimum 0, maximum 10000000).
196+
// 0 disables the override.
195197
double height = 2;
196198
// Overriding device scale factor value. 0 disables the override.
197199
double deviceScaleFactor = 3;
198-
// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
200+
// Whether to emulate mobile device. This includes viewport meta tag,
201+
// overlay scrollbars, text autosizing and more.
199202
bool mobile = 4;
200-
// Whether screen emulation is disabled. If true, the other emulation settings are ignored.
203+
// Whether screen emulation is disabled. If true, the other emulation
204+
// settings are ignored.
201205
bool disabled = 5;
202206
}
203207

204-
// Screen emulation properties (width, height, dpr, mobile viewport) to apply or an object of `{disabled: true}` if Lighthouse should avoid applying screen emulation. If either emulation is applied outside of Lighthouse, or it's being run on a mobile device, it typically should be set to disabled. For desktop, we recommend applying consistent desktop screen emulation.
208+
// Screen emulation properties (width, height, dpr, mobile viewport) to
209+
// apply or an object of `{disabled: true}` if Lighthouse should avoid
210+
// applying screen emulation. If either emulation is applied outside of
211+
// Lighthouse, or it's being run on a mobile device, it typically should be
212+
// set to disabled. For desktop, we recommend applying consistent desktop
213+
// screen emulation.
205214
ScreenEmulation screen_emulation = 9;
215+
216+
// The type(s) of report output to be produced: 'json' | 'html' | 'csv'
217+
string output = 10;
218+
219+
// The maximum amount of time to wait for a page content render, in ms. If
220+
// no content is rendered within this limit, the run is aborted with an
221+
// error.
222+
int64 max_wait_for_fcp = 11;
223+
// The maximum amount of time to wait for a page to load, in ms.
224+
int64 max_wait_for_load = 12;
225+
// The number of milliseconds to wait after FCP until the page should be
226+
// considered loaded.
227+
int64 pause_after_fcp_ms = 13;
228+
// The number of milliseconds to wait after the load event until the page
229+
// should be considered loaded.
230+
int64 pause_after_load_ms = 14;
231+
// The number of milliseconds to wait between high priority network requests
232+
// or 3 simultaneous requests before the page should be considered loaded.
233+
int64 network_quiet_threshold_ms = 15;
234+
// The number of milliseconds to wait between long tasks until the page
235+
// should be considered loaded.
236+
int64 cpu_quiet_threshold_ms = 16;
237+
238+
// User Agent string to apply, `false` to not change the host's UA string,
239+
// or `true` to use Lighthouse's default UA string.
240+
string emulated_user_agent = 17;
241+
// Flag indicating the run should only audit.
242+
bool audit_mode = 18;
243+
// Flag indicating the run should only gather.
244+
bool gather_mode = 19;
245+
// Flag indicating that the browser storage should not be reset for the
246+
// audit.
247+
bool disable_storage_reset = 20;
248+
// Flag indicating that Lighthouse should pause after page load to wait for
249+
// the user's permission to continue the audit.
250+
bool debug_navigation = 21;
251+
// If set to true, gatherers should avoid any behavior that may be
252+
// destructive to the page state. (e.g. extra navigations, resizing the
253+
// viewport)
254+
bool use_passive_gathering = 22;
255+
// Disables collection of the full page screenshot, which can be rather
256+
// large and possibly leave the page in an undesirable state.
257+
bool disable_full_page_screenshot = 23;
258+
// If set to true, will skip the initial navigation to about:blank.
259+
bool skip_about_blank = 24;
260+
// The URL to use for the "blank" neutral page in between navigations.
261+
// Defaults to `about:blank`.
262+
string blank_page = 25;
263+
264+
// List of URL patterns to block.
265+
repeated string blocked_url_patterns = 26;
266+
267+
// Comma-delimited list of trace categories to include.
268+
string additional_trace_categories = 27;
269+
270+
// If present, the run should only conduct this list of audits.
271+
repeated string only_audits = 28;
272+
// If present, the run should skip this list of audits.
273+
repeated string skip_audits = 29;
274+
275+
// Additional fields we haven't explicitly typed for proto:
276+
// budgets
277+
// extra_headers
278+
// precomputed_lantern_data
206279
}
207280

208281
// The settings that were used to run this audit
@@ -248,7 +321,8 @@ message LighthouseResult {
248321
// URL displayed on the page after Lighthouse finishes.
249322
string final_displayed_url = 18;
250323

251-
// Screenshot data of the full page, along with node rects relevant to the audit results.
324+
// Screenshot data of the full page, along with node rects relevant to the
325+
// audit results.
252326
google.protobuf.Value full_page_screenshot = 19;
253327

254328
// Entity classification data.
@@ -281,7 +355,7 @@ message LhrCategory {
281355
// This value is nullable, so is a `Value` type
282356
google.protobuf.Value score = 4;
283357

284-
// An description for manual audits within this category.
358+
// A description for manual audits within this category.
285359
string manual_description = 5;
286360

287361
// A Category's reference to an AuditResult, with a weight for category
@@ -390,19 +464,24 @@ message AuditResult {
390464

391465
// Message containing the audit's MetricSavings.
392466
message MetricSavings {
393-
// Optional numeric value representing the audit's savings for the LCP metric.
467+
// Optional numeric value representing the audit's savings for the LCP
468+
// metric.
394469
optional google.protobuf.DoubleValue LCP = 1;
395470

396-
// Optional numeric value representing the audit's savings for the FCP metric.
471+
// Optional numeric value representing the audit's savings for the FCP
472+
// metric.
397473
optional google.protobuf.DoubleValue FCP = 2;
398474

399-
// Optional numeric value representing the audit's savings for the CLS metric.
475+
// Optional numeric value representing the audit's savings for the CLS
476+
// metric.
400477
optional google.protobuf.DoubleValue CLS = 3;
401478

402-
// Optional numeric value representing the audit's savings for the TBT metric.
479+
// Optional numeric value representing the audit's savings for the TBT
480+
// metric.
403481
optional google.protobuf.DoubleValue TBT = 4;
404482

405-
// Optional numeric value representing the audit's savings for the INP metric.
483+
// Optional numeric value representing the audit's savings for the INP
484+
// metric.
406485
optional google.protobuf.DoubleValue INP = 5;
407486
}
408487

@@ -616,30 +695,34 @@ message I18n {
616695
// of a browser, whereas field data often summarizes hundreds+ of page loads
617696
string runtime_single_load_tooltip = 50;
618697

619-
// Descriptive label that this analysis only considers the initial load of the page,
620-
// and no interaction beyond when the page had "fully loaded"
698+
// Descriptive label that this analysis only considers the initial load of
699+
// the page, and no interaction beyond when the page had "fully loaded"
621700
string runtime_analysis_window = 51;
622701

623-
// Label for an interactive control that will reveal or hide a group of content.
624-
// This control toggles between the text 'Show' and 'Hide'.
702+
// Label for an interactive control that will reveal or hide a group of
703+
// content. This control toggles between the text 'Show' and 'Hide'.
625704
string show = 52;
626705

627-
// Label for an interactive control that will reveal or hide a group of content.
628-
// This control toggles between the text 'Show' and 'Hide'.
706+
// Label for an interactive control that will reveal or hide a group of
707+
// content. This control toggles between the text 'Show' and 'Hide'.
629708
string hide = 53;
630709

631-
// Label for an interactive control that will reveal or hide a group of content.
632-
// This control toggles between the text 'Expand view' and 'Collapse view'.
710+
// Label for an interactive control that will reveal or hide a group of
711+
// content. This control toggles between the text 'Expand view' and
712+
// 'Collapse view'.
633713
string expand_view = 54;
634714

635-
// Label for an interactive control that will reveal or hide a group of content.
636-
// This control toggles between the text 'Expand view' and 'Collapse view'.
715+
// Label for an interactive control that will reveal or hide a group of
716+
// content. This control toggles between the text 'Expand view' and
717+
// 'Collapse view'.
637718
string collapse_view = 55;
638719

639-
// Label indicating that Lighthouse throttled the page to emulate a slow 4G network connection.
720+
// Label indicating that Lighthouse throttled the page to emulate a slow 4G
721+
// network connection.
640722
string runtime_slow_4g = 56;
641723

642-
// Label indicating that Lighthouse throttled the page using custom throttling settings.
724+
// Label indicating that Lighthouse throttled the page using custom
725+
// throttling settings.
643726
string runtime_custom = 57;
644727

645728
// This label is for a button that will show the user a trace of the page.
@@ -654,28 +737,32 @@ message I18n {
654737
// Label for a row decorative chip indiciating entity is first-party.
655738
string first_party_chip_label = 61;
656739

657-
// Label for a link tooltip indicating that it will be opened in a new tab of the browser.
740+
// Label for a link tooltip indicating that it will be opened in a new tab
741+
// of the browser.
658742
string open_in_a_new_tab_tooltip = 62;
659743

660-
// Label for a generic category for all resources that could not be attributed against a 1st or 3rd party entity.
744+
// Label for a generic category for all resources that could not be
745+
// attributed against a 1st or 3rd party entity.
661746
string unattributable = 63;
662747

663748
// This label is for a button that will show the user a trace of the page.
664749
string dropdown_view_unthrottled_trace = 64;
665750

666-
// Descriptive label that this analysis considers some arbitrary period of time containing user interactions
751+
// Descriptive label that this analysis considers some arbitrary period of
752+
// time containing user interactions
667753
string runtime_analysis_window_timespan = 65;
668754

669-
// Descriptive label that this analysis considers a snapshot of the page at a single point in time
755+
// Descriptive label that this analysis considers a snapshot of the page at
756+
// a single point in time
670757
string runtime_analysis_window_snapshot = 66;
671758
}
672759

673760
// The message holding all formatted strings used in the renderer.
674761
RendererFormattedStrings renderer_formatted_strings = 1;
675762

676-
// Holds all message paths used. The locale of the report has already be used to translated
677-
// the strings in this LighthouseResult, but this field can be used to translate into another
678-
// language.
763+
// Holds all message paths used. The locale of the report has already be used
764+
// to translated the strings in this LighthouseResult, but this field can be
765+
// used to translate into another language.
679766
map<string, google.protobuf.ListValue> icu_message_paths = 2;
680767
}
681768

types/lhr/settings.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export type ScreenEmulationSettings = {
116116
pauseAfterFcpMs?: number;
117117
/** The number of milliseconds to wait after the load event until the page should be considered loaded. */
118118
pauseAfterLoadMs?: number;
119-
/** The number of milliseconds to wait between high priority network requests or 3 simulataneous requests before the page should be considered loaded. */
119+
/** The number of milliseconds to wait between high priority network requests or 3 simultaneous requests before the page should be considered loaded. */
120120
networkQuietThresholdMs?: number;
121121
/** The number of milliseconds to wait between long tasks until the page should be considered loaded. */
122122
cpuQuietThresholdMs?: number;

0 commit comments

Comments
 (0)