From fb76277ccf2e990635272773b68c436bd000fd64 Mon Sep 17 00:00:00 2001 From: Yuwei Huang Date: Wed, 23 Jun 2021 22:19:58 +0000 Subject: [PATCH] [remoting host][remote open url] Fix bug when XFCE fallback browser is not found Currently if the configure-url-forwarder script finds that the default browser of Cinnamon is the XFCE browser entry, then it will look for the XFCE default browser and make it the default browser for Cinnamon. This generally works fine, but it may raise a key-not-found exception in rare cases like the user has set up the URL forwarder then they somehow lose the host settings file. This CL simply makes the script skip overriding the default browser if the XFCE browser entry is not found. This would keep the fallback browser "xfce4-web-browser.desktop" for Cinnamon, but after crrev.com/c/2977713, the URL forwarder will detect the problem and ask the user to choose the fallback browser. Bug: b:183135000 Change-Id: Iee98e4af9ab4e8a54f0d3d15b2653424cf7f30ba Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2981073 Commit-Queue: Yuwei Huang Reviewed-by: Joe Downing Cr-Commit-Position: refs/heads/master@{#895342} --- remoting/host/linux/configure_url_forwarder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/remoting/host/linux/configure_url_forwarder.py b/remoting/host/linux/configure_url_forwarder.py index 6ae43e3f9bc024..a7137baa8a19d5 100755 --- a/remoting/host/linux/configure_url_forwarder.py +++ b/remoting/host/linux/configure_url_forwarder.py @@ -163,7 +163,11 @@ def setup_url_forwarder() -> None: XFCE4_WEB_BROWSER_DESKTOP_ENTRY, 'but XFCE is not found', file=sys.stderr) break - settings[setting_key] = settings[desktop_envs_and_setting_keys['XFCE']] + xfce_setting_key = desktop_envs_and_setting_keys['XFCE'] + if xfce_setting_key not in settings: + print('Cannot find', xfce_setting_key, 'in host settings.') + break + settings[setting_key] = settings[xfce_setting_key] save_host_settings_file(settings)