Skip to content

Commit

Permalink
Merge pull request catchpoint#641 from HTTPArchive/lighthouse
Browse files Browse the repository at this point in the history
Fixed the lighthouse user agent string
  • Loading branch information
mjkozicki authored Oct 25, 2023
2 parents 465638a + 1fc2900 commit acdd3ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/devtools_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def run_lighthouse_test(self, task):
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))
command.extend(['--emulatedUserAgent', "'" + sanitized_user_agent + "'"])
if len(task['block']):
for pattern in task['block']:
pattern = "'" + pattern.replace("'", "'\\''") + "'"
Expand Down

0 comments on commit acdd3ed

Please sign in to comment.