@@ -779,13 +779,12 @@ async def _launch_runtime(self) -> _RemoteSandboxRuntime:
779779 )
780780 break
781781 port = self ._pick_port ()
782+ flags = " " .join (self ._CHROMIUM_RUNTIME_FLAGS )
782783 launch_cmd = (
783784 f"mkdir -p { shlex .quote (base_dir )} && "
785+ f"(rm -rf { shlex .quote (base_dir )} /profile/WidevineCdm >/dev/null 2>&1 || true) && "
784786 "nohup chromium "
785- "--headless=new "
786- "--no-sandbox "
787- "--disable-dev-shm-usage "
788- "--disable-gpu "
787+ f"{ flags } "
789788 "--remote-debugging-address=127.0.0.1 "
790789 f"--remote-debugging-port={ port } "
791790 f"--user-data-dir={ shlex .quote (base_dir )} /profile "
@@ -1040,3 +1039,22 @@ async def _execute_sandbox_command(
10401039 _MAX_LAUNCH_TOTAL_SECONDS = 45.0
10411040 _HTTP_READY_TIMEOUT_SECONDS = 12.0
10421041 _WS_READY_TIMEOUT_SECONDS = 8.0
1042+ _CHROMIUM_RUNTIME_FLAGS = (
1043+ "--headless=new" ,
1044+ "--no-sandbox" ,
1045+ "--disable-setuid-sandbox" ,
1046+ "--disable-dev-shm-usage" ,
1047+ "--disable-gpu" ,
1048+ "--no-first-run" ,
1049+ "--no-default-browser-check" ,
1050+ "--disable-sync" ,
1051+ "--disable-background-networking" ,
1052+ "--disable-component-update" ,
1053+ "--disable-features=Translate,MediaRouter" ,
1054+ "--disable-session-crashed-bubble" ,
1055+ "--hide-crash-restore-bubble" ,
1056+ "--password-store=basic" ,
1057+ "--disable-breakpad" ,
1058+ "--disable-crash-reporter" ,
1059+ "--metrics-recording-only" ,
1060+ )
0 commit comments