default to http, open chrome automatically2

This commit is contained in:
wataru 2023-01-17 08:25:07 +09:00
parent ed246b65d2
commit 9b4a67ac66

View File

@ -190,8 +190,13 @@ if __name__ == '__main__':
if args.openWindow:
printMessage(f"ブラウザ(Chroem)の起動を試みています。", level=2)
try:
webbrowser.get('chrome')
webbrowser.get('chrome').open(f"http://localhost:{PORT}/{path}", new=1, autoraise=True)
webbrowser.get('google-chrome')
webbrowser.get('google-chrome').open(f"http://localhost:{PORT}/{path}", new=1, autoraise=True)
except Exception as e:
printMessage(f"!!! {e}", level=2)
try:
webbrowser.get("C:\Program Files\Google\Chrome\Application\chrome.exe")
webbrowser.get("C:\Program Files\Google\Chrome\Application\chrome.exe").open(f"http://localhost:{PORT}/{path}", new=1, autoraise=True)
except Exception as e:
printMessage(f"{e}", level=1)
printMessage(f"ブラウザの起動に失敗しました。", level=2)