diff options
-rw-r--r-- | dillorc | 2 | ||||
-rw-r--r-- | src/html.cc | 3 | ||||
-rw-r--r-- | src/prefs.c | 6 | ||||
-rw-r--r-- | src/prefs.h | 1 |
4 files changed, 12 insertions, 0 deletions
@@ -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 diff --git a/src/html.cc b/src/html.cc index 5dc1e1e7..5b70ecde 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2848,6 +2848,9 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) /* 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")) || diff --git a/src/prefs.c b/src/prefs.c index d7042924..2c8ec5df 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -73,6 +73,7 @@ typedef enum { 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 @@ static const SymNode_t symbols[] = { { "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 @@ static int Prefs_parse_pair(char *name, char *value) 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 @@ void a_Prefs_init(void) 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); diff --git a/src/prefs.h b/src/prefs.h index a12e5a37..67607533 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -57,6 +57,7 @@ struct _DilloPrefs { 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; |