From f9a65302933843264b16de8f8fb3c8602096345e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 21 Jul 2022 14:56:54 +0300 Subject: goodwolf: Added a way for certain tabs to use their own WebView while the -ng option isn't selected --- goodwolf.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'goodwolf.c') diff --git a/goodwolf.c b/goodwolf.c index a73ebd3..4350fd2 100644 --- a/goodwolf.c +++ b/goodwolf.c @@ -830,7 +830,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b window->content_manager, NULL)); - if (persistent_storage) { + if (persistent_storage && (old_browser == NULL || no_global_webview)) { char context_id_str[GOODWOLF_CTX_SIZ] = {0, 0, 0, 0, 0, 0, 0}; if (separated_storage) { fmt_context_id(browser->context_id, context_id_str, 0); @@ -1212,12 +1212,17 @@ Options:\n\ -ps Enables persistent storage, meaning non-session cookies will be stored on drive\n\ -st Enables separated storage, meaning cookie storage will be separated between tabs by\n\ their context label.\n\ - Doesn't do anything if the -sp option isn't selected.\n\ - Doesn't work properly without the -ng option.\n\ + Doesn't do anything without the -ps option. Without the -ng option, it only puts \n\ + cookies.txt in the folder of the first tab that uses the global WebView.\n\ -ng Disables global browser WebView. This significantly increases memory usage, roughly to\n\ 200-300MB per tab, but separates each tab into it's own process.\n\ Useful for debugging purposes and might improve security. Significantly increases page\n\ - load speed when multiple pages need to be loaded at once.\n"); + load speed when multiple pages need to be loaded at once.\n\ +\n\ +URL:\n\ + Has to be a valid web or file address.\n\ + If prefixed with a +, it will always create a seperate WebView for the corresponding tab. If you\n\ + want to use -st without -ng, you'll need to prefix all of your URLs with this character.\n"); return 0; } @@ -1367,7 +1372,11 @@ Options:\n\ goodwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, global_browser), FALSE); else for(int i = 1; i < argc; ++i) - goodwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], global_browser), TRUE); + goodwolf_new_tab(GTK_NOTEBOOK(window->notebook), + new_browser(window, + argv[i] + (argv[i][0] == '+'), + argv[i][0] == '+' ? NULL : global_browser), + TRUE); gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook), 1); -- cgit v1.3.1-26-gb76a