1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Browser: Add support for disabling content filtering

Just for completeness.
This commit is contained in:
Maciej 2022-02-01 11:17:37 +01:00 committed by Andreas Kling
parent 43e463748d
commit 4d1c28a23f
5 changed files with 26 additions and 6 deletions

View file

@ -89,7 +89,10 @@ Tab::Tab(BrowserWindow& window)
auto& webview_container = *find_descendant_of_type_named<GUI::Widget>("webview_container");
m_web_content_view = webview_container.add<Web::OutOfProcessWebView>();
m_web_content_view->set_content_filters(g_content_filters);
if (g_content_filters_enabled)
m_web_content_view->set_content_filters(g_content_filters);
else
m_web_content_view->set_content_filters({});
auto& go_back_button = toolbar.add_action(window.go_back_action());
go_back_button.on_context_menu_request = [this](auto& context_menu_event) {
@ -444,7 +447,10 @@ void Tab::context_menu_requested(const Gfx::IntPoint& screen_position)
void Tab::content_filters_changed()
{
m_web_content_view->set_content_filters(g_content_filters);
if (g_content_filters_enabled)
m_web_content_view->set_content_filters(g_content_filters);
else
m_web_content_view->set_content_filters({});
}
GUI::AbstractScrollableWidget& Tab::view()