From 8e650e3e39771431267aa6275d596516d1e34abb Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 30 Jul 2004 23:40:01 +0000 Subject: [project @ 2004-07-30 23:40:00 by jmb] Rework stylesheet fetching code to remove dependence on magic numbers (now uses values defined in html.h) Make ad blocking optional. svn path=/import/netsurf/; revision=1168 --- desktop/browser.c | 3 ++- desktop/options.c | 3 +++ desktop/options.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index fabd7ab4e..c4dcc5c54 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -432,7 +432,8 @@ void browser_window_reload(struct browser_window *bw, bool all) c->data.html.object[i].content->fresh = false; } /* invalidate stylesheets */ - for (i=2; i!=c->data.html.stylesheet_count; i++) { + for (i=STYLESHEET_START; + i!=c->data.html.stylesheet_count; i++) { if (c->data.html.stylesheet_content[i] != 0) c->data.html.stylesheet_content[i]->fresh = false; } diff --git a/desktop/options.c b/desktop/options.c index c999e0ea6..ab3653e1e 100644 --- a/desktop/options.c +++ b/desktop/options.c @@ -51,6 +51,8 @@ char *option_accept_language = 0; bool option_ssl_verify_certificates = true; /** Preferred maximum size of memory cache / bytes. */ int option_memory_cache_size = 2 * 1024 * 1024; +/** Whether to block advertisements */ +bool option_block_ads = false; EXTRA_OPTION_DEFINE @@ -71,6 +73,7 @@ struct { { "accept_language", OPTION_STRING, &option_accept_language }, { "ssl_verify_certificates", OPTION_BOOL, &option_ssl_verify_certificates }, { "memory_cache_size", OPTION_INTEGER, &option_memory_cache_size }, + { "block_advertisements", OPTION_BOOL, &option_block_ads }, EXTRA_OPTION_TABLE }; diff --git a/desktop/options.h b/desktop/options.h index 65fa59fc2..ae35cda94 100644 --- a/desktop/options.h +++ b/desktop/options.h @@ -38,6 +38,7 @@ extern int option_font_min_size; extern char *option_accept_language; extern bool option_ssl_verify_certificates; extern int option_memory_cache_size; +extern bool option_block_ads; void options_read(const char *path); void options_write(const char *path); -- cgit v1.2.3