]> git.armaanb.net Git - chorizo.git/commitdiff
Remove external URI handler
authorPeter Hofmann <scm@uninformativ.de>
Wed, 29 Apr 2020 16:05:09 +0000 (18:05 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Wed, 29 Apr 2020 16:05:09 +0000 (18:05 +0200)
CHANGES
browser.c
man1/lariza.1
man1/lariza.usage.1

diff --git a/CHANGES b/CHANGES
index d0d4464f7c7eb40a7ac7ee7c2a34eeb8f063cbe8..275a7035766f5e43157f5d7706f1ffa5bed0a384 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,8 @@ next
     https://www.uninformativ.de/blog/postings/2020-04-26/0/POSTING-en.html
   - Keyword searches have been removed, as these code paths were
     unmaintained.
+  - The "external URI handler" has been removed, as these code paths
+    were unmaintained.
 
 v20.04  2020-04-22
   [Fixed]
index 3c68dd3776e96f4aba7fb55761487bc94cb28262..2390b1cba0f4cdc862e72c81478e09bc4bb0ed5f 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -34,7 +34,6 @@ void downloadmanager_cancel(GtkToolButton *, gpointer);
 gboolean downloadmanager_delete(GtkWidget *, gpointer);
 void downloadmanager_setup(void);
 gchar *ensure_uri_scheme(const gchar *);
-void external_handler_run(GSimpleAction *, GVariant *, gpointer);
 void grab_environment_configuration(void);
 void grab_feeds_finished(GObject *, GAsyncResult *, gpointer);
 void hover_web_view(WebKitWebView *, WebKitHitTestResult *, guint, gpointer);
@@ -45,8 +44,6 @@ gboolean key_location(GtkWidget *, GdkEvent *, gpointer);
 gboolean key_tablabel(GtkWidget *, GdkEvent *, gpointer);
 gboolean key_web_view(GtkWidget *, GdkEvent *, gpointer);
 void mainwindow_setup(void);
-gboolean menu_web_view(WebKitWebView *, WebKitContextMenu *, GdkEvent *,
-                       WebKitHitTestResult *, gpointer);
 gboolean quit_if_nothing_active(void);
 gboolean remote_msg(GIOChannel *, GIOCondition, gpointer);
 void run_user_scripts(WebKitWebView *);
@@ -165,8 +162,6 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show,
                      G_CALLBACK(changed_load_progress), c);
     g_signal_connect(G_OBJECT(c->web_view), "create",
                      G_CALLBACK(client_new_request), NULL);
-    g_signal_connect(G_OBJECT(c->web_view), "context-menu",
-                     G_CALLBACK(menu_web_view), c);
     g_signal_connect(G_OBJECT(c->web_view), "close",
                      G_CALLBACK(client_destroy), c);
     g_signal_connect(G_OBJECT(c->web_view), "decide-policy",
@@ -665,29 +660,6 @@ ensure_uri_scheme(const gchar *t)
         return g_strdup(t);
 }
 
-void
-external_handler_run(GSimpleAction *simple, GVariant *param, gpointer data)
-{
-    struct Client *c = (struct Client *)data;
-    gchar *argv[] = { "lariza-external-handler", "-u", NULL, NULL };
-    GPid pid;
-    GError *err = NULL;
-
-    (void)simple;
-    (void)param;
-
-    argv[2] = c->external_handler_uri;
-    if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
-                       &pid, &err))
-    {
-        fprintf(stderr, __NAME__": Could not launch key handler: %s\n",
-                err->message);
-        g_error_free(err);
-    }
-    else
-        g_spawn_close_pid(pid);
-}
-
 void
 grab_environment_configuration(void)
 {
@@ -923,13 +895,6 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data)
                 case GDK_KEY_c:  /* reload trusted certs (left hand) */
                     trust_user_certs(wc);
                     return TRUE;
-                case GDK_KEY_x:  /* launch external handler (left hand) */
-                    if (c->external_handler_uri != NULL)
-                        g_free(c->external_handler_uri);
-                    c->external_handler_uri = g_strdup(
-                        webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view)));
-                    external_handler_run(NULL, NULL, c);
-                    return TRUE;
                 case GDK_KEY_a:  /* go one tab to the left (left hand) */
                     gtk_notebook_prev_page(GTK_NOTEBOOK(mw.notebook));
                     return TRUE;
@@ -1119,45 +1084,6 @@ mainwindow_setup(void)
     gtk_container_add(GTK_CONTAINER(mw.win), mw.notebook);
 }
 
-gboolean
-menu_web_view(WebKitWebView *web_view, WebKitContextMenu *menu, GdkEvent *ev,
-              WebKitHitTestResult *ht, gpointer data)
-{
-    struct Client *c = (struct Client *)data;
-    GSimpleAction *action = NULL;
-    WebKitContextMenuItem *mi = NULL;
-    const gchar *uri = NULL;
-
-    (void)ev;
-
-    if (webkit_hit_test_result_context_is_link(ht))
-        uri = webkit_hit_test_result_get_link_uri(ht);
-    else if (webkit_hit_test_result_context_is_image(ht))
-        uri = webkit_hit_test_result_get_image_uri(ht);
-    else if (webkit_hit_test_result_context_is_media(ht))
-        uri = webkit_hit_test_result_get_media_uri(ht);
-
-    if (uri != NULL)
-    {
-        webkit_context_menu_append(menu, webkit_context_menu_item_new_separator());
-
-        if (c->external_handler_uri != NULL)
-            g_free(c->external_handler_uri);
-        c->external_handler_uri = g_strdup(uri);
-        action = g_simple_action_new("external_handler", NULL);
-        g_signal_connect(G_OBJECT(action), "activate",
-                         G_CALLBACK(external_handler_run), data);
-        mi = webkit_context_menu_item_new_from_gaction(G_ACTION(action),
-                                                       "Open with external handler",
-                                                       NULL);
-        webkit_context_menu_append(menu, mi);
-        g_object_unref(action);
-    }
-
-    /* FALSE = Show the menu. (TRUE = Don't ever show it.) */
-    return FALSE;
-}
-
 gboolean
 quit_if_nothing_active(void)
 {
index a3cbb3f4925084642971af60e0cf3dbbdc951989..7931338629813104b931cc19c610c59a2edb3a70 100644 (file)
@@ -1,4 +1,4 @@
-.TH lariza 1 "2020-04-28" "lariza" "User Commands"
+.TH lariza 1 "2020-04-29" "lariza" "User Commands"
 .\" --------------------------------------------------------------------
 .SH NAME
 lariza \- simple web browser
@@ -97,10 +97,6 @@ Directory to store user-supplied JavaScript snippets. See
 \fI~/.local\:/share\:/lariza\:/web_extensions\fP
 Sets the directory where WebKit will look for web extensions. See
 \fBlariza.usage\fP(1).
-.P
-The executable \fIlariza-external-handler\fP must be located somewhere
-in your $\fBPATH\fP, if you want to make use of the external URI
-handler. See \fBlariza.usage\fP(1) for details.
 .\" --------------------------------------------------------------------
 .SH LICENSE
 \fBlariza\fP is released under the MIT license. See the accompanying
index b1162a6666ebd3000b920361aa81b824fbdc3773..336acafacc8f1b198575255f2bd93ad5d7c0bcb3 100644 (file)
@@ -1,4 +1,4 @@
-.TH lariza 1 "2020-04-28" "lariza" "User Commands"
+.TH lariza 1 "2020-04-29" "lariza" "User Commands"
 .\" --------------------------------------------------------------------
 .SH NAME
 lariza.usage \- extended usage hints
@@ -12,9 +12,6 @@ This manpage contains additional hints and pointers regarding its usage.
 These hotkeys work when either the location bar or the web view is being
 focused.
 .TP
-\fBMod1\fP + \fBx\fP
-Launch the external handler for the currently loaded URI.
-.TP
 \fBMod1\fP + \fBq\fP
 Close the current window. Quits the entire program if this was the last
 window and if there are no more active downloads (download manager is
@@ -155,33 +152,6 @@ Those bundled web extensions are automatically compiled when you run
 \fBmake\fP and installed on \fBmake install\fP. To use them, though,
 make sure to link them to the directory mentioned above.
 .\" --------------------------------------------------------------------
-.SH "EXTERNAL URI HANDLER"
-\fBlariza\fP can launch an executable called
-\fIlariza-external-handler\fP. It will be passed the \(lqselected\(rq
-URI as a command line argument:
-.P
-\f(CW
-.nf
-$ lariza-external-handler -u https://github.com
-.fi
-\fP
-.P
-This executable must be a user-supplied program. It can do anything it
-wants to with that URI. \fBlariza\fP ignores the exit code of the
-handler.
-.P
-The \fB\-u\fP will always be set. This allows you to use \fBgetopt\fP(1)
-like parameter parsing in your program.
-.P
-You can either use the appropriate hotkey (see list above) to launch the
-handler with the currently loaded URI, or you can perform a right click
-on any link, image or media file to use that URI.
-.P
-This mechanism allows you to implement a variety of functions. You might
-want to implement a bookmarking script or a password manager or you
-might simply load the current URI in a different browser. That's up to
-you.
-.\" --------------------------------------------------------------------
 .SH "TRUSTED CERTIFICATES"
 By default, \fBlariza\fP trusts whatever CAs are trusted by WebKit, i.e.
 by your GnuTLS installation. If you wish to trust additional