Commit 8edafec7 authored by Michael Catanzaro's avatar Michael Catanzaro

Add social media and annoyance blocking by default

parent 5a7ea146
......@@ -101,7 +101,7 @@
</key>
<key type="as" name="adblock-filters">
<default>['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt']</default>
<default>['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist.to/easylist/fanboy-annoyance.txt']</default>
<summary>List of adblock filters</summary>
<description>List of URLs with filter rules to be used by the adblock.</description>
</key>
......
......@@ -26,6 +26,8 @@ G_BEGIN_DECLS
#define ADBLOCK_DEFAULT_FILTER_URL "https://easylist.to/easylist/easylist.txt"
#define ADBLOCK_PRIVACY_FILTER_URL "https://easylist.to/easylist/easyprivacy.txt"
/* The annoyance filter includes the social button filter, which is important for privacy too. */
#define ADBLOCK_ANNOYANCE_FILTER_URL "https://easylist.to/easylist/fanboy-annoyance.txt"
GFile *ephy_uri_tester_get_adblock_filter_file (const char *adblock_data_dir,
const char *filter_url);
......
......@@ -1389,16 +1389,21 @@ do_not_track_button_clicked_cb (GtkWidget *button,
{
char **filters;
char **new_filters;
char **newer_filters;
filters = g_settings_get_strv (EPHY_SETTINGS_MAIN, EPHY_PREFS_ADBLOCK_FILTERS);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
new_filters = ephy_strv_append ((const char * const *)filters, ADBLOCK_PRIVACY_FILTER_URL);
else
newer_filters = ephy_strv_append ((const char * const *)new_filters, ADBLOCK_ANNOYANCE_FILTER_URL);
} else {
new_filters = ephy_strv_remove ((const char * const *)filters, ADBLOCK_PRIVACY_FILTER_URL);
g_settings_set_strv (EPHY_SETTINGS_MAIN, EPHY_PREFS_ADBLOCK_FILTERS, (const char * const *)new_filters);
newer_filters = ephy_strv_remove ((const char * const *)new_filters, ADBLOCK_ANNOYANCE_FILTER_URL);
}
g_settings_set_strv (EPHY_SETTINGS_MAIN, EPHY_PREFS_ADBLOCK_FILTERS, (const char * const *)newer_filters);
g_strfreev (filters);
g_strfreev (new_filters);
g_strfreev (newer_filters);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment