mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
WebContent+UI/Qt: Add debug option to toggle content filtering on/off
This was needed by @piruzzolo on Discord for debugging purposes and seems pretty useful :^)
This commit is contained in:
parent
00aa72c16e
commit
c361ea8916
Notes:
github-actions[bot]
2025-03-10 12:31:30 +00:00
Author: https://github.com/rmg-x
Commit: c361ea8916
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3844
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 24 additions and 0 deletions
|
@ -569,6 +569,17 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
|
|||
});
|
||||
});
|
||||
|
||||
m_enable_content_filtering_action = new QAction("Enable Content Filtering", this);
|
||||
m_enable_content_filtering_action->setCheckable(true);
|
||||
m_enable_content_filtering_action->setChecked(true);
|
||||
debug_menu->addAction(m_enable_content_filtering_action);
|
||||
QObject::connect(m_enable_content_filtering_action, &QAction::triggered, this, [this] {
|
||||
bool const state = m_enable_content_filtering_action->isChecked();
|
||||
for_each_tab([state](auto& tab) {
|
||||
tab.set_content_filtering(state);
|
||||
});
|
||||
});
|
||||
|
||||
m_block_pop_ups_action = new QAction("Block Pop-ups", this);
|
||||
m_block_pop_ups_action->setCheckable(true);
|
||||
m_block_pop_ups_action->setChecked(WebView::Application::chrome_options().allow_popups == WebView::AllowPopups::No);
|
||||
|
@ -828,6 +839,7 @@ void BrowserWindow::initialize_tab(Tab* tab)
|
|||
|
||||
tab->set_line_box_borders(m_show_line_box_borders_action->isChecked());
|
||||
tab->set_scripting(m_enable_scripting_action->isChecked());
|
||||
tab->set_content_filtering(m_enable_content_filtering_action->isChecked());
|
||||
tab->set_block_popups(m_block_pop_ups_action->isChecked());
|
||||
tab->set_same_origin_policy(m_enable_same_origin_policy_action->isChecked());
|
||||
tab->set_user_agent_string(user_agent_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue