summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-12 02:10:43 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-12 02:13:28 +0200
commit19de6bb1cc74bfda42f9b93c0a2c8f76b57a4ce9 (patch)
tree4123f388e261c6a1c176c5c7b4b928e60caf0089 /Userland/Applications
parentc181494b197b26861f88ef945afd87a86c9af363 (diff)
downloadserenity-19de6bb1cc74bfda42f9b93c0a2c8f76b57a4ce9.zip
LibWeb+Browser: Add Debug menu action for toggling Same-Origin Policy
Sometimes it's useful to turn off the SOP for testing purposes. Let's make that easy by having a Debug menu item for it. :^)
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index 8725279a5b..902da1d4b1 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -377,6 +377,15 @@ void BrowserWindow::build_menus()
spoof_user_agent_menu.add_action(custom_user_agent);
m_user_agent_spoof_actions.add_action(custom_user_agent);
+ debug_menu.add_separator();
+ auto same_origin_policy_action = GUI::Action::create_checkable(
+ "Enable Same &Origin Policy", [this](auto& action) {
+ active_tab().m_web_content_view->debug_request("same-origin-policy", action.is_checked() ? "on" : "off");
+ },
+ this);
+ same_origin_policy_action->set_checked(true);
+ debug_menu.add_action(same_origin_policy_action);
+
auto& help_menu = add_menu("&Help");
help_menu.add_action(WindowActions::the().about_action());
}