summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/options.c6
-rw-r--r--desktop/options.h2
-rw-r--r--render/box_construct.c12
-rw-r--r--riscos/options.h3
4 files changed, 17 insertions, 6 deletions
diff --git a/desktop/options.c b/desktop/options.c
index 131ac8917..0fbf40b32 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -97,6 +97,10 @@ bool option_block_ads = false;
int option_minimum_gif_delay = 10;
/** Whether to send the referer HTTP header */
bool option_send_referer = true;
+/** Whether to fetch foreground images */
+bool option_foreground_images = true;
+/** Whether to fetch background images */
+bool option_background_images = true;
/** Whether to animate images */
bool option_animate_images = true;
/** How many days to retain URL data for */
@@ -262,6 +266,8 @@ struct option_entry_s option_table[] = {
{ "block_advertisements", OPTION_BOOL, &option_block_ads },
{ "minimum_gif_delay", OPTION_INTEGER, &option_minimum_gif_delay },
{ "send_referer", OPTION_BOOL, &option_send_referer },
+ { "foreground_images", OPTION_BOOL, &option_foreground_images },
+ { "background_images", OPTION_BOOL, &option_background_images },
{ "animate_images", OPTION_BOOL, &option_animate_images },
{ "expire_url", OPTION_INTEGER, &option_expire_url },
{ "font_default", OPTION_INTEGER, &option_font_default },
diff --git a/desktop/options.h b/desktop/options.h
index cfc585c28..42375f9ef 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -58,6 +58,8 @@ extern int option_disc_cache_age;
extern bool option_block_ads;
extern int option_minimum_gif_delay;
extern bool option_send_referer;
+extern bool option_foreground_images;
+extern bool option_background_images;
extern bool option_animate_images;
extern int option_expire_url;
extern int option_font_default; /* a css_font_family */
diff --git a/render/box_construct.c b/render/box_construct.c
index 2aa9ff091..4b280fbe9 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -405,7 +405,8 @@ static bool box_construct_marker(struct box *box, const char *title,
}
if (css_computed_list_style_image(box->style, &image_uri) ==
- CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL) {
+ CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL &&
+ option_foreground_images == true) {
nsurl *url;
nserror error;
@@ -710,7 +711,8 @@ bool box_construct_element(struct box_construct_ctx *ctx,
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
- CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL) {
+ CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
+ option_background_images == true) {
nsurl *url;
nserror error;
@@ -1378,6 +1380,9 @@ bool box_image(BOX_SPECIAL_PARAMS)
box->length = strlen(box->text);
}
+ if (option_foreground_images == false)
+ return true;
+
/* imagemap associated with this image */
if (!box_get_attribute(n, "usemap", content, &box->usemap))
return false;
@@ -2035,7 +2040,8 @@ bool box_input(BOX_SPECIAL_PARAMS)
gadget->type = GADGET_IMAGE;
if (box->style && css_computed_display(box->style,
- n->parent == NULL) != CSS_DISPLAY_NONE) {
+ n->parent == NULL) != CSS_DISPLAY_NONE &&
+ option_foreground_images == true) {
if ((s = (char *) xmlGetProp(n,
(const xmlChar*) "src"))) {
error = nsurl_join(content->base_url, s, &url);
diff --git a/riscos/options.h b/riscos/options.h
index 463a6fa56..6aa6a8b20 100644
--- a/riscos/options.h
+++ b/riscos/options.h
@@ -44,7 +44,6 @@ extern char *option_toolbar_history;
extern char *option_toolbar_cookies;
extern bool option_window_stagger;
extern bool option_window_size_clone;
-extern bool option_background_images;
extern bool option_buffer_animations;
extern bool option_buffer_everything;
extern bool option_open_browser_at_startup;
@@ -84,7 +83,6 @@ char *option_toolbar_history = 0; \
char *option_toolbar_cookies = 0; \
bool option_window_stagger = true; \
bool option_window_size_clone = true; \
-bool option_background_images = true; \
bool option_buffer_animations = true; \
bool option_buffer_everything = true; \
bool option_open_browser_at_startup = false; \
@@ -124,7 +122,6 @@ char *option_external_hotlist_app = 0;
{ "toolbar_cookies", OPTION_STRING, &option_toolbar_cookies }, \
{ "window_stagger", OPTION_BOOL, &option_window_stagger }, \
{ "window_size_clone", OPTION_BOOL, &option_window_size_clone }, \
-{ "background_images", OPTION_BOOL, &option_background_images }, \
{ "buffer_animations", OPTION_BOOL, &option_buffer_animations }, \
{ "buffer_everything", OPTION_BOOL, &option_buffer_everything }, \
{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup }, \