This commit is contained in:
2024-12-04 17:19:46 +01:00
parent af390dd779
commit da8583ab28
36 changed files with 712 additions and 69 deletions

33
tools/itb/bin/itb_start Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
import random
import subprocess
import sys
def start(url):
debug_port = random.randint(9000, 9999)
chrome_cmd = [
'/usr/bin/google-chrome',
'--headless=new',
'--no-sandbox',
'--remote-debugging-port=' + str(debug_port),
url
]
process = subprocess.Popen(
chrome_cmd,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
start_new_session=True
)
print({
"pid": process.pid,
"debug_port": debug_port
})
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: itb_start <url>")
sys.exit(1)
start(sys.argv[1])