" return;"
" var URL = location.href;"
" var sites = new Array(); %s;"
- " var public = '';"
+ " var public = '.madblockplaceholder ';"
" for (var i in sites) {"
" if (URL.indexOf(i) != -1 && sites[i] ){"
" public += ', .'+sites[i];"
" break;"
" }}"
+ " public += ' {display: none !important}';"
" var mystyle = document.createElement('style');"
" mystyle.setAttribute('type', 'text/css');"
" mystyle.setAttribute('id', 'madblock');"
MidoriExtension* extension)
{
gchar* path;
+ MidoriApp* app;
+ MidoriWebSettings* settings;
if (webkit_download_get_status (download) != WEBKIT_DOWNLOAD_STATUS_FINISHED)
return;
adblock_parse_file (path);
g_free (path);
- MidoriApp* app = midori_extension_get_app (extension);
- MidoriWebSettings* settings = katze_object_get_object (app, "settings");
+ app = midori_extension_get_app (extension);
+ settings = katze_object_get_object (app, "settings");
+ g_string_append (blockcss, " {display: none !important}\n");
midori_web_settings_add_style (settings, "adblock-blockcss", blockcss->str);
katze_assign (blockscript, adblock_build_js (blockcssprivate->str));
g_object_unref (settings);
gchar* custom_list;
gchar** filters;
guint i = 0;
+ MidoriApp* app = midori_extension_get_app (extension);
+ MidoriWebSettings* settings = katze_object_get_object (app, "settings");
adblock_init_db ();
}
}
g_strfreev (filters);
+ g_string_append (blockcss, " {display: none !important}\n");
- MidoriApp* app = midori_extension_get_app (extension);
- MidoriWebSettings* settings = katze_object_get_object (app, "settings");
katze_assign (blockscript, adblock_build_js (blockcssprivate->str));
midori_web_settings_add_style (settings, "adblock-blockcss", blockcss->str);
g_object_unref (settings);
{
while (fgets (line, 2000, file))
adblock_parse_line (line);
- g_string_append (blockcss, "{display: none !important}\n");
fclose (file);
return TRUE;
}
MidoriBrowser* browser)
{
MidoriApp* app = midori_extension_get_app (extension);
+ MidoriWebSettings* settings = katze_object_get_object (app, "settings");
g_signal_handlers_disconnect_by_func (
browser, adblock_open_preferences_cb, extension);
g_string_free (blockcss, TRUE);
if (blockcssprivate)
g_string_free (blockcssprivate, TRUE);
+
+ midori_web_settings_remove_style (settings, "adblock-blockcss");
blockcssprivate = blockcss = NULL;
g_hash_table_destroy (pattern);
g_hash_table_destroy (optslist);
g_hash_table_destroy (urlcache);
+ g_object_unref (settings);
}
static void