From 140d9ebd912ed803dd916c6ab3783a79a2a724e3 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 14 Jun 2024 22:27:18 +0200 Subject: Add support for user actions in the link menu Allows the user to define additional entries in the link menu which will execute the given program/script. Each actions is defined using the "link_action" option. The link URL is stored in the $url enviroment variable and the current page in $origin, so the user can customize how do the handling. Here is a simple example to add three new entries: link_action="Debug variables:echo url=$url origin=$origin" link_action="Open in MPV:mpv $url" link_action="Open in Firefox:firefox $url" The command is spawned in a forked process using the system() call, which uses the shell to expand any variable. In particular, the $url variable is set to the current URL being opened. Fixes: https://github.com/dillo-browser/dillo/issues/3 --- src/uicmd.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/uicmd.hh') diff --git a/src/uicmd.hh b/src/uicmd.hh index f75d9a48..fe72486a 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -59,7 +59,7 @@ void a_UIcmd_findbar_toggle(BrowserWindow *bw, int on); void a_UIcmd_focus_main_area(BrowserWindow *bw); void a_UIcmd_focus_location(void *vbw); void a_UIcmd_page_popup(void *vbw, bool_t has_bugs, void *v_cssUrls); -void a_UIcmd_link_popup(void *vbw, const DilloUrl *url); +void a_UIcmd_link_popup(void *vbw, const DilloUrl *url, const DilloUrl *page_url); void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, bool_t loaded_img, DilloUrl *page_url, DilloUrl *link_url); void a_UIcmd_form_popup(void *vbw, const DilloUrl *url, void *vform, -- cgit v1.2.3