Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit6f5101265679f0753168da9487520b6479fa6fd1 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-07-17 19:39:23 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-07-17 19:39:23 +0300
Files938bb5d3607cecb3358894207ad39aae1e972608
goodwolf-6f5101265679f0753168da9487520b6479fa6fd1.tar
goodwolf-6f5101265679f0753168da9487520b6479fa6fd1.tar.gz
goodwolf-6f5101265679f0753168da9487520b6479fa6fd1.zip
Parent7981d89f239ff0731582d1911a8a6901129948fe (diff)
badwolf: Added the switch -g which allows separated permanent storage between tabs
2 files changed, 46 insertions, 35 deletions
-rw-r--r--badwolf.c13
-rw-r--r--po/messages.pot68
diff --git a/badwolf.c b/badwolf.c
index 5309a73..02e9dcf 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -32,6 +32,7 @@ static gboolean tray_enabled = false;
static gboolean alt_useragent = false;
static int custom_favicon_size = 30;
static gboolean persistent_storage = false;
+static gboolean separated_storage = false;
static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data);
static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
@@ -750,9 +751,17 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b
webkit_web_context_set_web_extensions_directory(web_context, web_extensions_directory);
webkit_web_context_set_favicon_database_directory(web_context, NULL);
if (persistent_storage) {
+ char context_id_str[BADWOLF_CTX_SIZ] = {0, 0, 0, 0, 0, 0, 0};
+ if (separated_storage) {
+ fmt_context_id(browser->context_id, context_id_str);
+ g_mkdir_with_parents(
+ g_build_filename(g_get_user_config_dir(), "badwolf", context_id_str, NULL),
+ 0755);
+ }
+
webkit_cookie_manager_set_persistent_storage(
webkit_website_data_manager_get_cookie_manager(website_data_manager),
- g_build_filename(g_get_user_config_dir(), "badwolf", "cookies.txt", NULL),
+ g_build_filename(g_get_user_config_dir(), "badwolf", context_id_str, "cookies.txt", NULL),
WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT);
webkit_cookie_manager_set_accept_policy(
webkit_website_data_manager_get_cookie_manager(website_data_manager),
@@ -1246,6 +1255,8 @@ main(int argc, char *argv[])
alt_useragent = TRUE;
else if (argv[1][1] == 'p')
persistent_storage = TRUE;
+ else if (argv[1][1] == 'g')
+ separated_storage = TRUE;
else if (argv[1][1] == 's') {
argv++;
argc--;
diff --git a/po/messages.pot b/po/messages.pot
index 239d8c2..f89be0b 100644
--- a/po/messages.pot
+++ b/po/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Badwolf 1.2.0+g6e9679c.develop\n"
"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n"
-"POT-Creation-Date: 2022-07-17 18:23+0300\n"
+"POT-Creation-Date: 2022-07-17 19:36+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -74,23 +74,23 @@ msgstr ""
msgid "Bookmarks: unable to parse file \"%s\"\n"
msgstr ""
-#: badwolf.c:1149
+#: badwolf.c:1158
#, c-format
msgid "Buildtime WebKit version: %d.%d.%d\n"
msgstr ""
-#: badwolf.c:482
+#: badwolf.c:483
msgid "Continue"
msgstr ""
-#: badwolf.c:427
+#: badwolf.c:428
msgid ""
"Couldn't verify the TLS certificate to ensure a better security of the "
"connection. You might want to verify your machine and network.\n"
"\n"
msgstr ""
-#: badwolf.c:111
+#: badwolf.c:112
msgid "Crashed"
msgstr ""
@@ -98,31 +98,31 @@ msgstr ""
msgid "Download starting…"
msgstr ""
-#: badwolf.c:450
+#: badwolf.c:451
msgid "Error: Some unknown error occurred validating the certificate.\n"
msgstr ""
-#: badwolf.c:431
+#: badwolf.c:432
msgid "Error: The X509 Certificate Authority is unknown.\n"
msgstr ""
-#: badwolf.c:444
+#: badwolf.c:445
msgid "Error: The certificate has been revoked.\n"
msgstr ""
-#: badwolf.c:441
+#: badwolf.c:442
msgid "Error: The certificate has expired. Check your system's clock.\n"
msgstr ""
-#: badwolf.c:447
+#: badwolf.c:448
msgid "Error: The certificate is considered to be insecure.\n"
msgstr ""
-#: badwolf.c:438
+#: badwolf.c:439
msgid "Error: The certificate isn't valid yet. Check your system's clock.\n"
msgstr ""
-#: badwolf.c:434
+#: badwolf.c:435
msgid "Error: The given identity doesn't match the expected one.\n"
msgstr ""
@@ -133,99 +133,99 @@ msgid ""
"Runtime WebKit version: %d.%d.%d"
msgstr ""
-#: badwolf.c:990
+#: badwolf.c:999
msgid "New tab"
msgstr ""
-#: badwolf.c:1219
+#: badwolf.c:1228
msgid "Open new tab"
msgstr ""
-#: badwolf.c:115
+#: badwolf.c:116
msgid "Out of Memory"
msgstr ""
-#: badwolf.c:1147
+#: badwolf.c:1156
#, c-format
msgid "Running Badwolf version: %s\n"
msgstr ""
-#: badwolf.c:1154
+#: badwolf.c:1163
#, c-format
msgid "Runtime WebKit version: %d.%d.%d\n"
msgstr ""
-#: badwolf.c:479
+#: badwolf.c:480
#, c-format
msgid "TLS Error for %s."
msgstr ""
-#: badwolf.c:482
+#: badwolf.c:483
msgid "Temporarily Add Exception"
msgstr ""
-#: badwolf.c:716
+#: badwolf.c:717
msgid "Toggle javascript"
msgstr ""
-#: badwolf.c:721
+#: badwolf.c:722
msgid "Toggle loading images automatically"
msgstr ""
-#: badwolf.c:119
+#: badwolf.c:120
msgid "Unknown Crash"
msgstr ""
-#: badwolf.c:719
+#: badwolf.c:720
msgid "_IMG"
msgstr ""
-#: badwolf.c:714
+#: badwolf.c:715
msgid "_JS"
msgstr ""
-#: badwolf.c:1068
+#: badwolf.c:1077
#, c-format
msgid "badwolf: content-filter loaded, adding to content-manager…\n"
msgstr ""
-#: badwolf.c:1088 badwolf.c:1095
+#: badwolf.c:1097 badwolf.c:1104
#, c-format
msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n"
msgstr ""
-#: badwolf.c:1056 badwolf.c:1061
+#: badwolf.c:1065 badwolf.c:1070
#, c-format
msgid "badwolf: failed to load content-filter, err: [%d] %s\n"
msgstr ""
-#: badwolf.c:1175
+#: badwolf.c:1184
#, c-format
msgid "content-filters file set to: %s\n"
msgstr ""
-#: badwolf.c:878
+#: badwolf.c:887
msgid "search in current page"
msgstr ""
-#: badwolf.c:110
+#: badwolf.c:111
msgid "the web process crashed.\n"
msgstr ""
-#: badwolf.c:114
+#: badwolf.c:115
msgid "the web process exceeded the memory limit.\n"
msgstr ""
-#: badwolf.c:118
+#: badwolf.c:119
msgid "the web process terminated for an unknown reason.\n"
msgstr ""
-#: badwolf.c:1161
+#: badwolf.c:1170
#, c-format
msgid "webkit-web-extension directory set to: %s\n"
msgstr ""
#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext.
-#: badwolf.c:1280
+#: badwolf.c:1291
msgid "ø"
msgstr ""