Skip to content

Commit

Permalink
report: support v6 settings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Dec 22, 2020
1 parent 2bdf6cb commit 6cb6812
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions lighthouse-core/report/html/renderer/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,24 @@ class Util {
networkThrottling = Util.i18n.strings.runtimeUnknown;
}

// TODO(paulirish): revise Runtime Settings strings: https://github.com/GoogleChrome/lighthouse/pull/11796
const deviceEmulation = settings.formFactor === 'mobile'
? Util.i18n.strings.runtimeMobileEmulation
: Util.i18n.strings.runtimeDesktopEmulation;

let deviceEmulation;
// COMPAT: remove this fallback handling at Lighthouse v8
// @ts-expect-error fallback handling for emulatedFormFactor
if (settings.emulatedFormFactor) {
// @ts-expect-error removed setting
deviceEmulation = settings.emulatedFormFactor === 'mobile'
? Util.i18n.strings.runtimeMobileEmulation
// @ts-expect-error removed setting
: settings.emulatedFormFactor === 'desktop'
? Util.i18n.strings.runtimeDesktopEmulation
: Util.i18n.strings.runtimeNoEmulation;
} else {
// TODO(paulirish): revise Runtime Settings strings: https://github.com/GoogleChrome/lighthouse/pull/11796
deviceEmulation = settings.formFactor === 'mobile'
? Util.i18n.strings.runtimeMobileEmulation
: Util.i18n.strings.runtimeDesktopEmulation;
}

return {
deviceEmulation,
Expand Down

0 comments on commit 6cb6812

Please sign in to comment.