diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2023-11-25 20:02:23 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2023-11-25 20:02:23 +0000 |
commit | 4cb38c4704e4ed11cf10fc046b32ef6ef5afa78f (patch) | |
tree | 2815b0f576b192a9bd84d386b6f4c0e0cee38197 /content/handlers/css | |
parent | 41de6cb6f8ee73a712e305f8c1b6d34090a24523 (diff) | |
download | netsurf-4cb38c4704e4ed11cf10fc046b32ef6ef5afa78f.tar.gz netsurf-4cb38c4704e4ed11cf10fc046b32ef6ef5afa78f.tar.bz2 |
css: Add option to ignore author level CSS
This adds a new config option, `author_level_css`.
When it is disabled, NetSurf will ignore all CSS from the web
page. In this case only the default CSS rules from the browser
and user CSS rules will be applied. It is enabled by default.
Tested by running:
./nsgtk3 --author_level_css=0
Diffstat (limited to 'content/handlers/css')
-rw-r--r-- | content/handlers/css/hints.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/content/handlers/css/hints.c b/content/handlers/css/hints.c index defeae10a..286befab9 100644 --- a/content/handlers/css/hints.c +++ b/content/handlers/css/hints.c @@ -1587,6 +1587,10 @@ static void css_hint_list( dom_exception err; dom_string *attr; + if (nsoption_bool(author_level_css) == false) { + return; + } + err = dom_element_get_attribute(node, corestring_dom_type, &attr); if (err == DOM_NO_ERR && attr != NULL) { const char *attr_str = dom_string_data(attr); |