Auto-dismiss Welcome to Chrome dialog; add suppress flags for first-run popups
This commit is contained in:
+13
-6
@@ -505,6 +505,9 @@ def launch_chrome():
|
||||
"--disable-session-crashed-bubble",
|
||||
"--disable-save-password-bubble",
|
||||
"--disable-restore-session-state",
|
||||
"--suppress-message-center-popups",
|
||||
"--disable-default-browser-check",
|
||||
"--no-first-run",
|
||||
"--disable-features=TranslateUI,OptimizationHints,OptimizationHintsFetching,OptimizationTargetPrediction,OptimizationGuideModelDownloading",
|
||||
"--disable-component-update",
|
||||
"--disable-background-networking",
|
||||
@@ -536,15 +539,19 @@ if __name__ == "__main__":
|
||||
|
||||
def dismiss_chrome_dialogs():
|
||||
"""
|
||||
Chrome sometimes shows a 'Profile error occurred' dialog on startup.
|
||||
This runs in the background and closes it automatically so the senior
|
||||
never sees it. We try a few times over 10 seconds to catch it.
|
||||
Chrome shows startup dialogs (first-run welcome, profile errors) on a
|
||||
fresh or corrupted profile. Dismiss them all automatically so the
|
||||
senior never sees them. Runs for ~15 seconds after startup.
|
||||
"""
|
||||
for _ in range(10):
|
||||
dialogs = [
|
||||
"Welcome to Google Chrome",
|
||||
"Profile error occurred",
|
||||
]
|
||||
for _ in range(15):
|
||||
time.sleep(1)
|
||||
for title in dialogs:
|
||||
subprocess.run(
|
||||
["xdotool", "search", "--name", "Profile error occurred",
|
||||
"key", "Return"],
|
||||
["xdotool", "search", "--name", title, "key", "Return"],
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user