add start_browser.py, starting chrome after websocket is ready

This commit is contained in:
2025-07-16 15:36:53 +02:00
parent 1b9db884db
commit 8a4dc7b50c

17
start_browser.py Normal file
View File

@@ -0,0 +1,17 @@
import os
import time
import socket
show = True
for _ in range(30):
try:
socket.create_connection(('localhost', 8010), timeout=1)
os.system('/usr/bin/chromium-browser http://localhost:8080/')
break
except Exception as e:
time.sleep(1)
if show:
print('waiting for frappy websocket')
show = False
else:
print('do not start chrome - waiting for frappy websocket failed')