mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Browser: Add support for disabling content filtering
Just for completeness.
This commit is contained in:
parent
43e463748d
commit
4d1c28a23f
Notes:
sideshowbarker
2024-07-17 18:35:03 +09:00
Author: https://github.com/sppmacd
Commit: 4d1c28a23f
Pull-request: https://github.com/SerenityOS/serenity/pull/12241
5 changed files with 26 additions and 6 deletions
|
@ -30,6 +30,7 @@ namespace Browser {
|
|||
String g_search_engine;
|
||||
String g_home_url;
|
||||
Vector<String> g_content_filters;
|
||||
bool g_content_filters_enabled { true };
|
||||
IconBag g_icon_bag;
|
||||
|
||||
}
|
||||
|
@ -88,6 +89,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Browser::g_home_url = Config::read_string("Browser", "Preferences", "Home", "file:///res/html/misc/welcome.html");
|
||||
Browser::g_search_engine = Config::read_string("Browser", "Preferences", "SearchEngine", {});
|
||||
Browser::g_content_filters_enabled = Config::read_bool("Browser", "Preferences", "EnableContentFilters");
|
||||
|
||||
Browser::g_icon_bag = TRY(Browser::IconBag::try_create());
|
||||
|
||||
|
@ -113,10 +115,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
dbgln("Reloading content filters failed: {}", error.release_error());
|
||||
return;
|
||||
}
|
||||
window->tab_widget().for_each_child_of_type<Browser::Tab>([](auto& tab) {
|
||||
tab.content_filters_changed();
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
window->content_filters_changed();
|
||||
};
|
||||
TRY(content_filters_watcher->add_watch(String::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory()), Core::FileWatcherEvent::Type::ContentModified));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue