in cortado/rtas/browser_debugging.py [0:0]
def main():
param1 = "--remote-debugging-port=9222"
param2 = "--user-data-dir=remote-profile"
current_os = _common.get_current_os()
if current_os == OSType.MACOS:
if platform.processor() == "arm":
name = "com.apple.ditto_and_spawn_arm"
else:
name = "com.apple.ditto_and_spawn_intel"
source = _common.get_resource_path(f"bin/{name}")
chrome = "/tmp/google-chrome"
_common.copy_file(source, chrome)
log.info("Starting browser on debug mode")
_ = _common.execute_command([chrome, param1, param2], timeout_secs=10)
elif current_os == OSType.LINUX:
name = "linux.ditto_and_spawn"
source = _common.get_resource_path(f"bin/{name}")
chrome = "/tmp/google-chrome"
_common.copy_file(source, chrome)
log.info("Starting browser on debug mode")
_ = _common.execute_command([chrome, param1, param2], timeout_secs=10)
else:
EXE_FILE = _common.get_resource_path("bin/renamed_posh.exe")
chrome = "C:\\Users\\Public\\chrome.exe"
_common.copy_file(EXE_FILE, chrome)
# Execute command
log.info("Mimicking the start of a browser on debug mode")
_ = _common.execute_command([chrome, "/c", "echo", param1, param2], timeout_secs=10)
_common.remove_file(chrome)