From 817e3a4f1db9553721a1414774cb647be8c124b3 Mon Sep 17 00:00:00 2001 From: Morozov Pavel <77216072+PavelMor25@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:53:07 +0400 Subject: [PATCH] feat: add default args to chrome (#8341) ## Purpose ## Approach `--disable-search-engine-choice-screen` Disables the screen that prompts users to select a default search engine when launching the browser for the first time. `--disable-component-extensions-with-background-pages` Prevents component extensions with background pages (extensions running in the background) from being loaded. `--allow-pre-commit-input` Allows user input before a commit action completes, usually related to development or debugging tasks. `--disable-background-networking` Disables any networking tasks that would typically run in the background, such as preloading content or updating components. `--disable-background-timer-throttling` Stops the throttling of background timers, ensuring background tabs have the same timer performance as active tabs. `--disable-backgrounding-occluded-windows` Prevents reducing the priority of windows that are fully covered (occluded) by other windows. `--disable-breakpad` Disables the Breakpad crash reporting system, preventing crash reports from being sent to developers. `--disable-client-side-phishing-detection` Turns off the browser's built-in phishing detection mechanisms. `--disable-default-apps` Prevents default apps from being installed on first run, often used in testing environments. `--disable-extensions` Disables all browser extensions. `--disable-hang-monitor` Turns off the monitoring of hung browser processes, which could otherwise trigger recovery or debugging processes. `--disable-infobars` Prevents informational bars (like "Chrome is being controlled by automated test software") from appearing. `--disable-ipc-flooding-protection` Removes protections against flooding inter-process communication (IPC) channels with too many messages. `--disable-popup-blocking` Turns off the browser's pop-up blocker, allowing all pop-ups to appear. `--disable-prompt-on-repost` Disables the warning when a form is re-submitted (a repost). `--disable-renderer-backgrounding` Prevents renderer processes from being deprioritized when they are in the background. `--disable-sync` Disables the browser's syncing features, such as syncing bookmarks, settings, and history. `--enable-automation` Indicates that the browser is being controlled by automated testing software (like Selenium). `--export-tagged-pdf` Exports PDFs with tagged metadata for accessibility. `--generate-pdf-document-outline` Generates a document outline (e.g., a table of contents) for exported PDFs. `--force-color-profile=srgb` Forces the use of the sRGB color profile for consistent color rendering. `--metrics-recording-only` Limits functionality to only record performance metrics, often used for diagnostics. `--no-first-run` Skips the first-run experience, such as the welcome screen and initial setup dialogs. `--password-store=basic` Configures the browser to use a simple, unencrypted password store. `--use-mock-keychain` Replaces the system's keychain (for password management) with a mock version, typically for testing environments. ## References closes Devexpress/testcafe-private#526 ## Pre-Merge TODO - [ ] Write tests for your proposed changes - [ ] Make sure that existing tests do not fail --- .../dedicated/chrome/build-chrome-args.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/browser/provider/built-in/dedicated/chrome/build-chrome-args.js b/src/browser/provider/built-in/dedicated/chrome/build-chrome-args.js index 48d03950bb..0630adbcea 100644 --- a/src/browser/provider/built-in/dedicated/chrome/build-chrome-args.js +++ b/src/browser/provider/built-in/dedicated/chrome/build-chrome-args.js @@ -5,6 +5,29 @@ export function buildChromeArgs ({ config, cdpPort, platformArgs, tempProfileDir const defaultArgs = [ '--disable-search-engine-choice-screen', '--disable-component-extensions-with-background-pages', + '--allow-pre-commit-input', + '--disable-background-networking', + '--disable-background-timer-throttling', + '--disable-backgrounding-occluded-windows', + '--disable-breakpad', + '--disable-client-side-phishing-detection', + '--disable-default-apps', + '--disable-extensions', + '--disable-hang-monitor', + '--disable-infobars', + '--disable-ipc-flooding-protection', + '--disable-popup-blocking', + '--disable-prompt-on-repost', + '--disable-renderer-backgrounding', + '--disable-sync', + '--enable-automation', + '--export-tagged-pdf', + '--generate-pdf-document-outline', + '--force-color-profile=srgb', + '--metrics-recording-only', + '--no-first-run', + '--password-store=basic', + '--use-mock-keychain', ]; let chromeArgs = []