Skip to content
Snippets Groups Projects
Commit 6c223bb8 authored by Michael Catanzaro's avatar Michael Catanzaro Committed by Marge Bot
Browse files

window: launch URLs whenever triggered by user gesture

Currently we check the default app for the URI scheme and call
gtk_show_uri_on_window() only if the default app is not NULL and is not
Epiphany. This fails under flatpak because there we cannot check the
user's default apps. It is always NULL, so we bail out and refuse to
launch any app for the URL. Oops.

This code was originally added to prevent us from launching Epiphany in
a recursive loop if it somehow gets registered as the default handler
for a scheme that it doesn't actually support, as in #1053. In this
case, we should only relaunch ourselves once because the second launch
will be triggered by API request, when the new instance calls
webkit_web_view_load_uri(). That's not a user gesture and will avoid the
recursion.

This change also prevents websites from opening URLs without user
intervention.

Thanks to Adrian Perez for proposing this solution!

Fixes #1385

Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/951>
parent e596dad5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment