changeset 747:0df766ebc2e9

add load_stylesheets option Setting load_stylesheets=NO will disable loading of remote CSS stylesheets. CSS style information embedded in the page with <style></style> elements will still be used.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 09 Jan 2009 16:36:08 +0100
parents 01af11519375
children 291f5cf844bd
files dillorc src/html.cc src/prefs.c src/prefs.h
diffstat 4 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dillorc	Fri Jan 09 14:10:19 2009 +0100
+++ b/dillorc	Fri Jan 09 16:36:08 2009 +0100
@@ -18,6 +18,8 @@
 # (there's a toggle button near the bug meter to change this on-the-fly)
 #load_images=YES
 
+# Change this if you want to disable loading of CSS stylesheets.
+#load_stylesheets=YES
 
 # Change the buffering scheme for drawing
 # 0 no double buffering - useful for debugging
--- a/src/html.cc	Fri Jan 09 14:10:19 2009 +0100
+++ b/src/html.cc	Fri Jan 09 16:36:08 2009 +0100
@@ -2848,6 +2848,9 @@
    /* TODO: How will we know when to use "handheld"? Ask the html->bw->ui for
       screen dimensions, or a dillorc preference. */
 
+   if (!prefs.load_stylesheets)
+      return;
+
    /* CSS stylesheet link */
    if ((!(attrbuf = a_Html_get_attr(html, tag, tagsize, "rel")) ||
         dStrcasecmp(attrbuf, "stylesheet")) ||
--- a/src/prefs.c	Fri Jan 09 14:10:19 2009 +0100
+++ b/src/prefs.c	Fri Jan 09 16:36:08 2009 +0100
@@ -73,6 +73,7 @@
    DRC_TOKEN_LIMIT_TEXT_WIDTH,
    DRC_TOKEN_LINK_COLOR,
    DRC_TOKEN_LOAD_IMAGES,
+   DRC_TOKEN_LOAD_STYLESHEETS,
    DRC_TOKEN_BUFFERED_DRAWING,
    DRC_TOKEN_MIDDLE_CLICK_OPENS_NEW_TAB,
    DRC_TOKEN_NOPROXY,
@@ -138,6 +139,7 @@
    { "limit_text_width", DRC_TOKEN_LIMIT_TEXT_WIDTH },
    { "link_color", DRC_TOKEN_LINK_COLOR },
    { "load_images", DRC_TOKEN_LOAD_IMAGES },
+   { "load_stylesheets", DRC_TOKEN_LOAD_STYLESHEETS },
    { "middle_click_drags_page", DRC_TOKEN_MIDDLE_CLICK_DRAGS_PAGE },
    { "middle_click_opens_new_tab", DRC_TOKEN_MIDDLE_CLICK_OPENS_NEW_TAB },
    { "no_proxy", DRC_TOKEN_NOPROXY },
@@ -324,6 +326,9 @@
    case DRC_TOKEN_LOAD_IMAGES:
       prefs.load_images = (strcmp(value, "YES") == 0);
       break;
+   case DRC_TOKEN_LOAD_STYLESHEETS:
+      prefs.load_stylesheets = (strcmp(value, "YES") == 0);
+      break;
    case DRC_TOKEN_BUFFERED_DRAWING:
       prefs.buffered_drawing = atoi(value);
       break;
@@ -450,6 +455,7 @@
    prefs.show_progress_box=TRUE;
    prefs.fullwindow_start=FALSE;
    prefs.load_images=TRUE;
+   prefs.load_stylesheets=TRUE;
    prefs.buffered_drawing=1;
    prefs.vw_fontname = dStrdup(D_VW_FONTNAME);
    prefs.fw_fontname = dStrdup(D_FW_FONTNAME);
--- a/src/prefs.h	Fri Jan 09 14:10:19 2009 +0100
+++ b/src/prefs.h	Fri Jan 09 16:36:08 2009 +0100
@@ -57,6 +57,7 @@
    bool_t show_progress_box;
    bool_t fullwindow_start;
    bool_t load_images;
+   bool_t load_stylesheets;
    int32_t buffered_drawing;
    char *vw_fontname;
    char *fw_fontname;