commit: 5ae418fad6a6986cf3ef8b711fbc3666b76c8604
parent: ced6d8f90c54c8d0277b46712384d28839359aa1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 11 Mar 2019 10:05:51 +0100
Bugfix: Use the state of the button to set javascript
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -232,13 +232,12 @@ static gboolean locationCb_activate(GtkEntry *location, gpointer user_data)
static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data)
{
- (void)javascript;
struct Client *browser = (struct Client *)user_data;
WebKitSettings *settings = webkit_web_view_get_settings(browser->webView);
- gboolean javascript_enabled = webkit_settings_get_enable_javascript(settings);
- webkit_settings_set_enable_javascript(settings, !javascript_enabled);
+ webkit_settings_set_enable_javascript(
+ settings, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(javascript)));
webkit_web_view_set_settings(browser->webView, settings);