mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 00:40:15 +03:00
Add core options to disable fetch of foreground & background images.
Remove broken background image option from RISC OS front end. svn path=/trunk/netsurf/; revision=13332
This commit is contained in:
parent
95714a0c00
commit
081217a321
@ -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 },
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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 }, \
|
||||
|
Loading…
Reference in New Issue
Block a user