From ac5ca0fc6392bda274973ee4fac9976ff52a4071 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 14 Jul 2020 17:22:45 +0200 Subject: [PATCH] mitmweb: use x-www-browser --- mitmproxy/tools/web/webaddons.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mitmproxy/tools/web/webaddons.py b/mitmproxy/tools/web/webaddons.py index 57f6e75f1..c90604b9c 100644 --- a/mitmproxy/tools/web/webaddons.py +++ b/mitmproxy/tools/web/webaddons.py @@ -44,7 +44,9 @@ def open_browser(url: str) -> bool: False, if no suitable browser has been found. """ browsers = ( - "windows-default", "wslview %s", "macosx", + "windows-default", "macosx", + "wslview %s", + "x-www-browser %s", "gnome-open %s", "google-chrome", "chrome", "chromium", "chromium-browser", "firefox", "opera", "safari", ) @@ -54,6 +56,6 @@ def open_browser(url: str) -> bool: except webbrowser.Error: pass else: - b.open(url) - return True + if b.open(url): + return True return False