Skip to content

Commit

Permalink
Merge pull request #434 from WPO-Foundation/433
Browse files Browse the repository at this point in the history
Stop checking for LH version <7 and use new params by default
  • Loading branch information
tkadlec authored Sep 27, 2021
2 parents 92f4856 + b45f054 commit 908b325
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/devtools_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,15 +798,13 @@ def run_lighthouse_test(self, task):
command.append('--save-assets')
if not self.job['keep_lighthouse_screenshots']:
command.extend(['--skip-audits', 'screenshot-thumbnails,final-screenshot'])
form_factor_command = '--form-factor' if lighthouse_version >= 7 else '--emulated-form-factor'
form_factor_command = '--form-factor'
if self.options.android:
command.extend([form_factor_command, 'mobile'])
if lighthouse_version >= 7:
command.extend(['--screenEmulation.disabled'])
command.extend(['--screenEmulation.disabled'])
elif 'mobile' not in self.job or not self.job['mobile']:
command.extend([form_factor_command, 'desktop'])
if lighthouse_version >= 7:
command.extend(['--screenEmulation.disabled'])
command.extend(['--screenEmulation.disabled'])
if 'user_agent_string' in self.job:
sanitized_user_agent = re.sub(r'[^a-zA-Z0-9_\-.;:/()\[\] ]+', '', self.job['user_agent_string'])
command.append('--chrome-flags="--user-agent=\'{0}\'"'.format(sanitized_user_agent))
Expand Down

0 comments on commit 908b325

Please sign in to comment.