Skip to content

Commit

Permalink
[remoting host][remote open url] Fix bug when XFCE fallback browser i…
Browse files Browse the repository at this point in the history
…s 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 <yuweih@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#895342}
  • Loading branch information
ywh233 authored and Chromium LUCI CQ committed Jun 23, 2021
1 parent 03decb2 commit fb76277
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion remoting/host/linux/configure_url_forwarder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit fb76277

Please sign in to comment.