summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-30 23:05:21 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-30 23:16:41 +0100
commitded78fc0747ee45d4ca81bd21e51c09f3d80e232 (patch)
tree115bc2a0b450c9592bd611e9ef1bd74eecd6c58e /Userland/Applications/Browser/main.cpp
parent74c8490acd9fa1c0687804f30e2f1ec336442c4d (diff)
downloadserenity-ded78fc0747ee45d4ca81bd21e51c09f3d80e232.zip
Browser: Turn on multi-process mode by default :^)
Frick it, let's just enable this by default and give ourselves a reason to improve things! Some things are broken, and there's a bit of flicker when resizing, but we can do this. This drastically improves our web browsing security model by isolating each tab into its own WebContent process that runs as an unprivileged user with a tight pledge+unveil sandbox. To get a single-process browser, you can start it with -s.
Diffstat (limited to 'Userland/Applications/Browser/main.cpp')
-rw-r--r--Userland/Applications/Browser/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp
index 694e25354b..c79eeefad9 100644
--- a/Userland/Applications/Browser/main.cpp
+++ b/Userland/Applications/Browser/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,7 +51,7 @@
namespace Browser {
String g_home_url;
-bool g_multi_process = false;
+static bool s_single_process = false;
static String bookmarks_file_path()
{
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
const char* specified_url = nullptr;
Core::ArgsParser args_parser;
- args_parser.add_option(Browser::g_multi_process, "Multi-process mode", "multi-process", 'm');
+ args_parser.add_option(Browser::s_single_process, "Single-process mode", "single-process", 's');
args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
@@ -180,7 +180,7 @@ int main(int argc, char** argv)
Function<void(URL url, bool activate)> create_new_tab;
create_new_tab = [&](auto url, auto activate) {
- auto type = Browser::g_multi_process ? Browser::Tab::Type::OutOfProcessWebView : Browser::Tab::Type::InProcessWebView;
+ auto type = Browser::s_single_process ? Browser::Tab::Type::InProcessWebView : Browser::Tab::Type::OutOfProcessWebView;
auto& new_tab = tab_widget.add_tab<Browser::Tab>("New tab", type);
tab_widget.set_bar_visible(!window->is_fullscreen() && tab_widget.children().size() > 1);