summaryrefslogtreecommitdiff
path: root/Ladybird
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-11-15 01:49:05 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commitfad3fbfe26378b5711b5cf099e0e498675420e17 (patch)
treec7ca91c6e3541c0bc32ce277ba7f33b9b941e350 /Ladybird
parent948c4ba1028f8f9e3dd5088f23681bd6b9c9f550 (diff)
downloadserenity-fad3fbfe26378b5711b5cf099e0e498675420e17.zip
Ladybird: Add block pop-ups checkbox to debug menu
Diffstat (limited to 'Ladybird')
-rw-r--r--Ladybird/BrowserWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Ladybird/BrowserWindow.cpp b/Ladybird/BrowserWindow.cpp
index 1bddaa7822..3c37f884b2 100644
--- a/Ladybird/BrowserWindow.cpp
+++ b/Ladybird/BrowserWindow.cpp
@@ -248,6 +248,15 @@ BrowserWindow::BrowserWindow(int webdriver_fd_passing_socket)
debug_request("scripting", state ? "on" : "off");
});
+ auto* block_pop_ups_action = new QAction("Block Pop-ups", this);
+ block_pop_ups_action->setCheckable(true);
+ block_pop_ups_action->setChecked(true);
+ debug_menu->addAction(block_pop_ups_action);
+ QObject::connect(block_pop_ups_action, &QAction::triggered, this, [this, block_pop_ups_action] {
+ bool state = block_pop_ups_action->isChecked();
+ debug_request("block-pop-ups", state ? "on" : "off");
+ });
+
auto* enable_same_origin_policy_action = new QAction("Enable Same-Origin Policy", this);
enable_same_origin_policy_action->setCheckable(true);
debug_menu->addAction(enable_same_origin_policy_action);