[wiki] [sites] [surf][patches][zoommtg-handler] added zoommtg scheme handler || Lars Niesen
commit 98534d6b5bb9ab888b1af00056afed15c67135fb
Author: Lars Niesen <lars.niesen_AT_gmx.de>
Date: Thu Dec 9 14:49:04 2021 +0100
[surf][patches][zoommtg-handler] added zoommtg scheme handler
diff --git a/surf.suckless.org/patches/zoommtg-handler/index.md b/surf.suckless.org/patches/zoommtg-handler/index.md
new file mode 100644
index 00000000..937b1fcf
--- /dev/null
+++ b/surf.suckless.org/patches/zoommtg-handler/index.md
_AT_@ -0,0 +1,18 @@
+zoommtg scheme handler
+======================
+
+Description
+-----------
+
+This patch uses xdg-open to open zoommtg links
+
+
+Download
+--------
+
+* [surf-zoommtghandler-2.1.diff](surf-zoommtghandler-2.1.diff) (2021-12-09)
+
+Author
+------
+
+* Lars Niesen <lars.niesen_AT_gmx.de>
diff --git a/surf.suckless.org/patches/zoommtg-handler/surf-zoommtghandler-2.1.diff b/surf.suckless.org/patches/zoommtg-handler/surf-zoommtghandler-2.1.diff
new file mode 100644
index 00000000..dfcbd522
--- /dev/null
+++ b/surf.suckless.org/patches/zoommtg-handler/surf-zoommtghandler-2.1.diff
_AT_@ -0,0 +1,69 @@
+From 47c1ddc06052c5a86aaab8bc4a5a3fe59995b30b Mon Sep 17 00:00:00 2001
+From: Lars Niesen <lars.niesen_AT_gmx.de>
+Date: Thu, 9 Dec 2021 14:42:13 +0100
+Subject: [PATCH] added zoommtg scheme handler
+
+---
+ surf.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/surf.c b/surf.c
+index af0fa74..338045c 100644
+--- a/surf.c
++++ b/surf.c
+_AT_@ -217,6 +217,8 @@ static void webprocessterminated(WebKitWebView *v,
+ static void closeview(WebKitWebView *v, Client *c);
+ static void destroywin(GtkWidget* w, Client *c);
+
++static void handle_zoommtg(WebKitURISchemeRequest *request);
++
+ /* Hotkeys */
+ static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
+ static void reload(Client *c, const Arg *a);
+_AT_@ -562,6 +564,7 @@ loaduri(Client *c, const Arg *a)
+ if (g_strcmp0(uri, "") == 0)
+ return;
+
++
+ if (g_str_has_prefix(uri, "http://") ||
+ g_str_has_prefix(uri, "https://") ||
+ g_str_has_prefix(uri, "file://") ||
+_AT_@ -1182,6 +1185,9 @@ newview(Client *c, WebKitWebView *rv)
+ g_signal_connect(G_OBJECT(context), "initialize-web-extensions",
+ G_CALLBACK(initwebextensions), c);
+
++ webkit_web_context_register_uri_scheme(context, "zoommtg",
++ (WebKitURISchemeRequestCallback)handle_zoommtg, NULL, NULL);
++
+ v = g_object_new(WEBKIT_TYPE_WEB_VIEW,
+ "settings", settings,
+ "user-content-manager", contentmanager,
+_AT_@ -1776,6 +1782,25 @@ destroywin(GtkWidget* w, Client *c)
+ gtk_main_quit();
+ }
+
++void
++handle_zoommtg(WebKitURISchemeRequest *request)
++{
++ char* uri = webkit_uri_scheme_request_get_uri (request);
++ Arg a = (Arg)PLUMB(uri);
++ printf("handleplumb: %s",(char*)a.v);
++ if (fork() == 0) {
++ if (dpy)
++ close(ConnectionNumber(dpy));
++ close(spair[0]);
++ close(spair[1]);
++ setsid();
++ execvp(((char **)a.v)[0], (char **)a.v);
++ fprintf(stderr, "%s: execvp %s", argv0, ((char **)a.v)[0]);
++ perror(" failed");
++ exit(1);
++ }
++}
++
+ void
+ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
+ {
+--
+2.34.1
+
Received on Thu Dec 09 2021 - 14:47:28 CET
This archive was generated by hypermail 2.3.0
: Thu Dec 09 2021 - 14:48:45 CET