Hi list, 

Here is a patch to add a new tab page to dillo. You can define any url
in dillorc preference 'new_tab_page', and it will be automatically
opened in new tabs. Setting the value "about:blank" will retain the
default blank page behavior. I tried to make it work with an empty
value of "", but for some reason dillo prepends 'http:' to the value.
Hopefully this won't be a problem, because now the about:blank is
pre-selected and you can just start typing over it. If there is a
better way to do this, I'm open to suggestions.  

Regards,
Alex


--- dillorc     Thu Apr 11 11:11:01 2024
+++ dillorc     Thu Apr 11 11:14:18 2024
@@ -154,6 +154,11 @@
 # home="file:/home/jcid/HomePage/Home.html"
 #home="https://dillo-browser.github.io/";
 
+# Set the new tab page.
+# new_tab_page="dpi:/bm/"
+# new_tab_page="https://example.com/";
#new_tab_page="about:blank"
+
 # Set the URLs used by the web search dialog.
 # "%s" is replaced with the search keywords separated by '+'.
 # Format: search_url="[prefix ][<label> ]<url>"


--- src/prefs.c     Thu Apr 11 11:18:24 2024
+++ src/prefs.c     Thu Apr 11 11:21:16 2024
@@ -14,6 +14,7 @@
 
 #define PREFS_START_PAGE      "about:splash"
 #define PREFS_HOME            "https://dillo-browser.github.io/";
+#define PREFS_NEW_TAB_PAGE    "about:blank"
 #define PREFS_FONT_SERIF      "DejaVu Serif"
 #define PREFS_FONT_SANS_SERIF "DejaVu Sans"
 #define PREFS_FONT_CURSIVE    "URW Chancery L"
@@ -109,6 +110,7 @@
    prefs.show_ui_tooltip = TRUE;
    prefs.small_icons = FALSE;
    prefs.start_page = a_Url_new(PREFS_START_PAGE, NULL);
+   prefs.new_tab_page = a_Url_new(PREFS_NEW_TAB_PAGE, NULL);
    prefs.theme = dStrdup(PREFS_THEME);
    prefs.ui_button_highlight_color = -1;
    prefs.ui_fg_color = -1;
@@ -143,6 +145,7 @@
    dFree(prefs.font_sans_serif);
    dFree(prefs.font_serif);
    a_Url_free(prefs.home);
+   a_Url_free(prefs.new_tab_page);
    dFree(prefs.http_language);
    a_Url_free(prefs.http_proxy);
    dFree(prefs.http_proxyuser);


--- src/prefs.h     Thu Apr 11 11:23:35 2024
+++ src/prefs.h     Thu Apr 11 11:24:35 2024
@@ -48,6 +48,7 @@
    char *no_proxy;
    DilloUrl *start_page;
    DilloUrl *home;
+   DilloUrl *new_tab_page;
    bool_t allow_white_bg;
    int32_t white_bg_replacement;
    int32_t bg_color;


--- src/prefsparser.cc      Thu Apr 11 11:26:31 2024
+++ src/prefsparser.cc      Thu Apr 11 11:28:12 2024
@@ -171,6 +171,7 @@
       { "fullwindow_start", &prefs.fullwindow_start, PREFS_BOOL, 0 },
       { "geometry", NULL, PREFS_GEOMETRY, 0 },
       { "home", &prefs.home, PREFS_URL, 0 },
+      { "new_tab_page", &prefs.new_tab_page, PREFS_URL, 0 },
       { "http_language", &prefs.http_language, PREFS_STRING, 0 },
       { "http_max_conns", &prefs.http_max_conns, PREFS_INT32, 0 },
       { "http_persistent_conns", &prefs.http_persistent_conns,
PREFS_BOOL, 0 },

--- src/uicmd.cc    Thu Apr 11 11:31:18 2024
+++ src/uicmd.cc    Thu Apr 11 12:06:13 2024
@@ -778,6 +778,7 @@
       a_UIcmd_set_location_text(new_bw, URL_STR(url));
       BW2UI(new_bw)->focus_main();
    } else {
+      a_UIcmd_open_url((BrowserWindow*)new_bw, prefs.new_tab_page);
       BW2UI(new_bw)->focus_location();
       a_UIcmd_set_buttons_sens(new_bw);
    }
_______________________________________________
Dillo-dev mailing list -- dillo-dev@mailman3.com
To unsubscribe send an email to dillo-dev-le...@mailman3.com

Reply via email to