badwolf-0.0.3-bugfix_javascript-toggle.patch (1103B)
1 From ab625a729cf4baa7ca1b22a6c1f2021cce8bf4ec Mon Sep 17 00:00:00 2001
2 From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
3 Date: Mon, 11 Mar 2019 10:05:51 +0100
4 Subject: [PATCH 1/2] Bugfix: Use the state of the button to set javascript
5
6 ---
7 badwolf.c | 5 ++---
8 1 file changed, 2 insertions(+), 3 deletions(-)
9
10 diff --git a/badwolf.c b/badwolf.c
11 index 003dda5..bfdde4c 100644
12 --- a/badwolf.c
13 +++ b/badwolf.c
14 @@ -131,13 +131,12 @@ static gboolean locationCb_activate(GtkEntry *location, gpointer user_data)
15
16 static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data)
17 {
18 - (void)javascript;
19 struct Client *browser = (struct Client *)user_data;
20
21 WebKitSettings *settings = webkit_web_view_get_settings(browser->webView);
22
23 - gboolean javascript_enabled = webkit_settings_get_enable_javascript(settings);
24 - webkit_settings_set_enable_javascript(settings, !javascript_enabled);
25 + webkit_settings_set_enable_javascript(
26 + settings, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(javascript)));
27
28 webkit_web_view_set_settings(browser->webView, settings);
29
30 --
31 2.19.2
32