I have an idea with minimal changes in dillo and various scripts. - Activate and format some MSGs in dillo - use a script to run dillo so saves and load tabs MSGs based
Example: patch with make a script run_dillo.sh fn load_tabs ... dillo $@ | while read line echo $line # process dillo MSGs # MSG("a_UIcmd_open_url_nw: open url in new window '%s' bw=%p new_bw=%p\n", URL_STR(url), (void *) bw, (void *) new_bw); # MSG("a_UIcmd_open_url_nt: open url in new tab '%s' bw=%p new_bw=%p\n", URL_STR(url), (void *) bw, (void *) new_bw); # MSG("a_UIcmd_close_bw bw=%p\n", (void *) bw); # MSG("Nav_open_url: old_url='%s' idx=%d bw=%p\n", URL_STR(old_url), idx, (void *) bw); # MSG("Nav_open_url: saved scroll of '%s' at x=%d y=%d bw=%p\n", URL_STR(old_url), x, y, (void *) bw); # MSG("Nav: expect_done scrolling to x=%d y=%d bw=%p\n", posx, posy, (void *) bw); selec $line a_UIcmd_open_url_nw) ;; open new window anote bw a_UIcmd_open_url_nt) ;; open new tab anote bw a_UIcmd_close_bw) ;; delete window or tab Nav_open_url: old_url) ;; change url for tab Nav_open_url: saved scroll) ;; annotate scroll pos Nav: expect_done scrolling to) ;; annotate scroll pos Dillo: normal exit) ;; annotate normal exit El jue, 12 sept 2024 a las 20:01, <a...@dismail.de> escribió: > > Hi, > > It would be nice to have the ability to save a list of open tabs. Often > I find myself shutting down my workstation and still have many tabs > open in Dillo. Its a pain to go through them all at that moment to > decide whats worth saving or bookmarking. > > An option to save all open tab urls to a file would be great. It would > be even nicer if we could later open all those urls in new tabs when > starting Dillo :) > > On first glance it doesn't seem very easy to implement, but also > maybe not super complicated either. I don't have any patches yet, just > wanted to put the idea out and see what you think about it. > > Regards, > Alex > > > > _______________________________________________ > Dillo-dev mailing list -- dillo-dev@mailman3.com > To unsubscribe send an email to dillo-dev-le...@mailman3.com
diff -pru dillo/dillo-3.1.1/src/nav.c /tmp/dillo-3.1.1-restore_tabs/src/nav.c --- dillo/dillo-3.1.1/src/nav.c 2024-05-04 13:01:21.000000000 +0200 +++ /tmp/dillo-3.1.1-restore_tabs/src/nav.c 2024-09-14 01:08:21.574577466 +0200 @@ -206,13 +206,14 @@ static void Nav_open_url(BrowserWindow * /* Get the url of the current page */ idx = a_Nav_stack_ptr(bw); old_url = a_History_get_url(NAV_UIDX(bw, idx)); - _MSG("Nav_open_url: old_url='%s' idx=%d\n", URL_STR(old_url), idx); + MSG("Nav_open_url: old_url='%s' idx=%d bw=%p\n", + URL_STR(old_url), idx, (void *) bw); /* Record current scrolling position */ if (old_url && !IgnoreScroll) { a_UIcmd_get_scroll_xy(bw, &x, &y); Nav_save_scroll_pos(bw, idx, x, y); - _MSG("Nav_open_url: saved scroll of '%s' at x=%d y=%d\n", - URL_STR(old_url), x, y); + MSG("Nav_open_url: saved scroll of '%s' at x=%d y=%d bw=%p\n", + URL_STR(old_url), x, y, (void *) bw); } /* Update navigation-stack-pointer (offset may be zero) */ @@ -319,7 +320,8 @@ void a_Nav_expect_done(BrowserWindow *bw /* Scroll to where we were in this page */ Nav_get_scroll_pos(bw, &posx, &posy); a_UIcmd_set_scroll_xy(bw, posx, posy); - _MSG("Nav: expect_done scrolling to x=%d y=%d\n", posx, posy); + MSG("Nav: expect_done scrolling to x=%d y=%d bw=%p\n", + posx, posy, (void *) bw); } else if (fragment) { /* Scroll to fragment */ a_UIcmd_set_scroll_by_fragment(bw, fragment); diff -pru dillo/dillo-3.1.1/src/uicmd.cc /tmp/dillo-3.1.1-restore_tabs/src/uicmd.cc --- dillo/dillo-3.1.1/src/uicmd.cc 2024-05-04 13:01:21.000000000 +0200 +++ /tmp/dillo-3.1.1-restore_tabs/src/uicmd.cc 2024-09-14 01:08:21.574577466 +0200 @@ -655,7 +655,7 @@ void a_UIcmd_close_bw(void *vbw) CustTabs *tabs = ui->tabs(); Layout *layout = (Layout*)bw->render_layout; - _MSG("a_UIcmd_close_bw\n"); + MSG("a_UIcmd_close_bw bw=%p\n", (void *) bw); a_Bw_stop_clients(bw, BW_Root + BW_Img + BW_Force); delete(layout); if (tabs) { @@ -794,6 +794,8 @@ void a_UIcmd_open_url_nw(BrowserWindow * a_UIcmd_get_wh(bw, &w, &h); new_bw = a_UIcmd_browser_window_new(w, h, 0, bw); + MSG("a_UIcmd_open_url_nw: open url in new window '%s' bw=%p new_bw=%p\n", URL_STR(url), (void *) bw, (void *) new_bw); + UIcmd_open_url_nbw(new_bw, url); } @@ -805,6 +807,7 @@ void a_UIcmd_open_url_nt(void *vbw, cons BrowserWindow *bw = (BrowserWindow *)vbw; BrowserWindow *new_bw = UIcmd_tab_new(BW2UI(bw)->tabs(), bw ? BW2UI(bw) : NULL, focus); + MSG("a_UIcmd_open_url_nt: open url in new tab '%s' bw=%p new_bw=%p\n", URL_STR(url), (void *) bw, (void *) new_bw); UIcmd_open_url_nbw(new_bw, url); }
_______________________________________________ Dillo-dev mailing list -- dillo-dev@mailman3.com To unsubscribe send an email to dillo-dev-le...@mailman3.com