From 1fc29001585cef4bd83658d3aaae68db29cc83d6 Mon Sep 17 00:00:00 2001 From: Patrick Meenan Date: Tue, 10 Oct 2023 14:52:37 -0400 Subject: [PATCH] Fixed the lighthouse user agent string --- internal/devtools_browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/devtools_browser.py b/internal/devtools_browser.py index c55d7a976..0049b53c2 100644 --- a/internal/devtools_browser.py +++ b/internal/devtools_browser.py @@ -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("'", "'\\''") + "'"