summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2019-01-03 00:02:36 +0100
committerGitHub <noreply@github.com>2019-01-03 00:02:36 +0100
commit31aa08031389442a71a0768f2017940477c281ce (patch)
treee46245bfc22ec728e2448d2a4ce531cdb35d5f16
parentd919b2f5ec55a1d35fa41cdf014be2211147a411 (diff)
downloadmidori-git-31aa08031389442a71a0768f2017940477c281ce.tar.gz
Forward URIs we can't display to show_uri (#236)
This handles for example apt:foo style links. Fixes: #234
-rw-r--r--core/tab.vala10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/tab.vala b/core/tab.vala
index c817d737..e8197d6c 100644
--- a/core/tab.vala
+++ b/core/tab.vala
@@ -187,6 +187,16 @@ namespace Midori {
return false;
}
+ // Forward URIs that WebKit can't show to external handler
+ if (load_error is WebKit.PolicyError.CANNOT_SHOW_URI) {
+ try {
+ Gtk.show_uri (get_screen (), uri, Gtk.get_current_event_time ());
+ } catch (Error error) {
+ critical ("Failed to open %s: %s", uri, error.message);
+ }
+ return true;
+ }
+
var monitor = NetworkMonitor.get_default ();
string hostname = new Soup.URI (uri).host;
string? title = null;