1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

Browser+WebContent: Add a Debug menu action to disable scripting :^)

This commit is contained in:
Linus Groh 2022-03-30 23:29:15 +01:00 committed by Andreas Kling
parent 780e5441b4
commit 04e40b7aaa
2 changed files with 12 additions and 0 deletions

View file

@ -378,6 +378,14 @@ void BrowserWindow::build_menus()
m_user_agent_spoof_actions.add_action(custom_user_agent);
debug_menu.add_separator();
auto scripting_enabled_action = GUI::Action::create_checkable(
"Enable Scripting", [this](auto& action) {
active_tab().m_web_content_view->debug_request("scripting", action.is_checked() ? "on" : "off");
},
this);
scripting_enabled_action->set_checked(true);
debug_menu.add_action(scripting_enabled_action);
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");