summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-07-30 23:40:01 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-07-30 23:40:01 +0000
commit8e650e3e39771431267aa6275d596516d1e34abb (patch)
tree89b376e980f7ba32abd4d2df53c676f1290af803 /desktop
parentd601aa71887b45b4fbd1c1c86f5cfe2971100216 (diff)
downloadnetsurf-8e650e3e39771431267aa6275d596516d1e34abb.tar.gz
netsurf-8e650e3e39771431267aa6275d596516d1e34abb.tar.bz2
[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
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c3
-rw-r--r--desktop/options.c3
-rw-r--r--desktop/options.h1
3 files changed, 6 insertions, 1 deletions
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);