Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit996ce01ea696a5ce741ad817cbe52b6e4d90145b (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-07-17 18:23:39 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-07-17 18:23:39 +0300
Files3f20099632be5356355c7841b9dff65073cdfc7b
goodwolf-996ce01ea696a5ce741ad817cbe52b6e4d90145b.tar
goodwolf-996ce01ea696a5ce741ad817cbe52b6e4d90145b.tar.gz
goodwolf-996ce01ea696a5ce741ad817cbe52b6e4d90145b.zip
Parent8fcfce66f010bc5b96dbff02428b3d05447aa85d (diff)
badwolf: Added the switch -p which enables persistent storage
2 files changed, 62 insertions, 47 deletions
-rw-r--r--badwolf.c17
-rw-r--r--po/messages.pot92
diff --git a/badwolf.c b/badwolf.c
index 1c61e67..5309a73 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -31,6 +31,7 @@ static gboolean tabs_constant = false;
static gboolean tray_enabled = false;
static gboolean alt_useragent = false;
static int custom_favicon_size = 30;
+static gboolean persistent_storage = false;
static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data);
static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
@@ -736,7 +737,9 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b
if(old_browser == NULL)
{
- WebKitWebsiteDataManager *website_data_manager = webkit_website_data_manager_new_ephemeral();
+ WebKitWebsiteDataManager *website_data_manager =
+ (persistent_storage) ? webkit_website_data_manager_new(NULL)
+ : webkit_website_data_manager_new_ephemeral();
webkit_website_data_manager_set_itp_enabled(website_data_manager, TRUE);
web_context = webkit_web_context_new_with_website_data_manager(website_data_manager);
@@ -746,6 +749,15 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b
WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
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) {
+ 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),
+ WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT);
+ webkit_cookie_manager_set_accept_policy(
+ webkit_website_data_manager_get_cookie_manager(website_data_manager),
+ WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);
+ }
g_signal_connect(G_OBJECT(web_context),
"download-started",
@@ -1232,11 +1244,14 @@ main(int argc, char *argv[])
tray_enabled = TRUE;
else if (argv[1][1] == 'u')
alt_useragent = TRUE;
+ else if (argv[1][1] == 'p')
+ persistent_storage = TRUE;
else if (argv[1][1] == 's') {
argv++;
argc--;
custom_favicon_size = (argv[1][0] - '0') * 10 + argv[1][1] - '0';
}
+
argv++;
argc--;
}
diff --git a/po/messages.pot b/po/messages.pot
index e4fbe56..239d8c2 100644
--- a/po/messages.pot
+++ b/po/messages.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Badwolf 1.0.3+gedbbb27.develop\n"
+"Project-Id-Version: Badwolf 1.2.0+g6e9679c.develop\n"
"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n"
-"POT-Creation-Date: 2021-04-09 08:48+0200\n"
+"POT-Creation-Date: 2022-07-17 18:23+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"
@@ -17,31 +17,31 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: downloads.c:117
+#: downloads.c:122
#, c-format
msgid "%02i:%02i:%02i Download cancelled"
msgstr ""
-#: downloads.c:119
+#: downloads.c:124
#, c-format
msgid "%02i:%02i:%02i Download error"
msgstr ""
-#: downloads.c:141
+#: downloads.c:145
#, c-format
msgid "%02i:%02i:%02i Download finished"
msgstr ""
-#: downloads.c:167
+#: downloads.c:172
#, c-format
msgid "%02i:%02i:%02i Downloading…"
msgstr ""
-#: downloads.c:199 downloads.c:216 downloads.c:219
+#: downloads.c:209 downloads.c:212
msgid "Badwolf Downloads"
msgstr ""
-#: bookmarks.c:116
+#: bookmarks.c:115
msgid "Bookmarks: Done.\n"
msgstr ""
@@ -50,17 +50,17 @@ msgstr ""
msgid "Bookmarks: Found %d bookmarks.\n"
msgstr ""
-#: bookmarks.c:81
+#: bookmarks.c:83
#, c-format
msgid "Bookmarks: No loadable file found at %s\n"
msgstr ""
-#: bookmarks.c:85
+#: bookmarks.c:87
#, c-format
msgid "Bookmarks: loading at %s\n"
msgstr ""
-#: bookmarks.c:99
+#: bookmarks.c:100
msgid "Bookmarks: unable to create new XPath context\n"
msgstr ""
@@ -69,60 +69,60 @@ msgstr ""
msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n"
msgstr ""
-#: bookmarks.c:89
+#: bookmarks.c:91
#, c-format
msgid "Bookmarks: unable to parse file \"%s\"\n"
msgstr ""
-#: badwolf.c:1034
+#: badwolf.c:1149
#, c-format
msgid "Buildtime WebKit version: %d.%d.%d\n"
msgstr ""
-#: badwolf.c:440
+#: badwolf.c:482
msgid "Continue"
msgstr ""
-#: badwolf.c:390
+#: badwolf.c:427
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:100
+#: badwolf.c:111
msgid "Crashed"
msgstr ""
-#: downloads.c:39
+#: downloads.c:43
msgid "Download starting…"
msgstr ""
-#: badwolf.c:413
+#: badwolf.c:450
msgid "Error: Some unknown error occurred validating the certificate.\n"
msgstr ""
-#: badwolf.c:394
+#: badwolf.c:431
msgid "Error: The X509 Certificate Authority is unknown.\n"
msgstr ""
-#: badwolf.c:407
+#: badwolf.c:444
msgid "Error: The certificate has been revoked.\n"
msgstr ""
-#: badwolf.c:404
+#: badwolf.c:441
msgid "Error: The certificate has expired. Check your system's clock.\n"
msgstr ""
-#: badwolf.c:410
+#: badwolf.c:447
msgid "Error: The certificate is considered to be insecure.\n"
msgstr ""
-#: badwolf.c:401
+#: badwolf.c:438
msgid "Error: The certificate isn't valid yet. Check your system's clock.\n"
msgstr ""
-#: badwolf.c:397
+#: badwolf.c:434
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:904
+#: badwolf.c:990
msgid "New tab"
msgstr ""
-#: badwolf.c:1102
+#: badwolf.c:1219
msgid "Open new tab"
msgstr ""
-#: badwolf.c:104
+#: badwolf.c:115
msgid "Out of Memory"
msgstr ""
-#: badwolf.c:1032
+#: badwolf.c:1147
#, c-format
msgid "Running Badwolf version: %s\n"
msgstr ""
-#: badwolf.c:1039
+#: badwolf.c:1154
#, c-format
msgid "Runtime WebKit version: %d.%d.%d\n"
msgstr ""
-#: badwolf.c:437
+#: badwolf.c:479
#, c-format
msgid "TLS Error for %s."
msgstr ""
-#: badwolf.c:440
+#: badwolf.c:482
msgid "Temporarily Add Exception"
msgstr ""
-#: badwolf.c:650
+#: badwolf.c:716
msgid "Toggle javascript"
msgstr ""
-#: badwolf.c:655
+#: badwolf.c:721
msgid "Toggle loading images automatically"
msgstr ""
-#: badwolf.c:108
+#: badwolf.c:119
msgid "Unknown Crash"
msgstr ""
-#: badwolf.c:653
+#: badwolf.c:719
msgid "_IMG"
msgstr ""
-#: badwolf.c:648
+#: badwolf.c:714
msgid "_JS"
msgstr ""
-#: badwolf.c:982
+#: badwolf.c:1068
#, c-format
msgid "badwolf: content-filter loaded, adding to content-manager…\n"
msgstr ""
-#: badwolf.c:1002 badwolf.c:1009
+#: badwolf.c:1088 badwolf.c:1095
#, c-format
msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n"
msgstr ""
-#: badwolf.c:970 badwolf.c:975
+#: badwolf.c:1056 badwolf.c:1061
#, c-format
msgid "badwolf: failed to load content-filter, err: [%d] %s\n"
msgstr ""
-#: badwolf.c:1060
+#: badwolf.c:1175
#, c-format
msgid "content-filters file set to: %s\n"
msgstr ""
-#: badwolf.c:792
+#: badwolf.c:878
msgid "search in current page"
msgstr ""
-#: badwolf.c:99
+#: badwolf.c:110
msgid "the web process crashed.\n"
msgstr ""
-#: badwolf.c:103
+#: badwolf.c:114
msgid "the web process exceeded the memory limit.\n"
msgstr ""
-#: badwolf.c:107
+#: badwolf.c:118
msgid "the web process terminated for an unknown reason.\n"
msgstr ""
-#: badwolf.c:1046
+#: badwolf.c:1161
#, c-format
msgid "webkit-web-extension directory set to: %s\n"
msgstr ""
#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext.
-#: badwolf.c:1138
+#: badwolf.c:1280
msgid "ø"
msgstr ""