Title: [279337] trunk/Tools
Revision
279337
Author
[email protected]
Date
2021-06-28 05:41:01 -0700 (Mon, 28 Jun 2021)

Log Message

[GTK] MiniBrowser: add an option to enable the web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=227343

Reviewed by Michael Catanzaro.

* MiniBrowser/gtk/main.c:
(activate):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (279336 => 279337)


--- trunk/Tools/ChangeLog	2021-06-28 12:40:31 UTC (rev 279336)
+++ trunk/Tools/ChangeLog	2021-06-28 12:41:01 UTC (rev 279337)
@@ -1,3 +1,14 @@
+2021-06-28  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] MiniBrowser: add an option to enable the web process sandbox
+        https://bugs.webkit.org/show_bug.cgi?id=227343
+
+        Reviewed by Michael Catanzaro.
+
+        * MiniBrowser/gtk/main.c:
+        (activate):
+        (main):
+
 2021-06-28  Daniel Kolesa  <[email protected]>
 
         [GTK][WPE] Add libvpx to jhbuild

Modified: trunk/Tools/MiniBrowser/gtk/main.c (279336 => 279337)


--- trunk/Tools/MiniBrowser/gtk/main.c	2021-06-28 12:40:31 UTC (rev 279336)
+++ trunk/Tools/MiniBrowser/gtk/main.c	2021-06-28 12:41:01 UTC (rev 279337)
@@ -52,6 +52,7 @@
 static const char *proxy;
 static gboolean darkMode;
 static gboolean enableITP;
+static gboolean enableSandbox;
 static gboolean exitAfterLoad;
 static gboolean webProcessCrashed;
 static gboolean printVersion;
@@ -145,6 +146,7 @@
     { "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", NULL },
     { "content-filter", 0, 0, G_OPTION_ARG_FILENAME, &contentFilter, "JSON with content filtering rules", "FILE" },
     { "enable-itp", 0, 0, G_OPTION_ARG_NONE, &enableITP, "Enable Intelligent Tracking Prevention (ITP)", NULL },
+    { "enable-sandbox", 0, 0, G_OPTION_ARG_NONE, &enableSandbox, "Enable web process sandbox support", NULL },
     { "exit-after-load", 0, 0, G_OPTION_ARG_NONE, &exitAfterLoad, "Quit the browser after the load finishes", NULL },
     { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WebKitGTK version", NULL },
     { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
@@ -674,6 +676,9 @@
         NULL);
     g_object_unref(manager);
 
+    if (enableSandbox)
+        webkit_web_context_set_sandbox_enabled(webContext, TRUE);
+
     if (cookiesPolicy) {
         WebKitCookieManager *cookieManager = webkit_web_context_get_cookie_manager(webContext);
         GEnumClass *enumClass = g_type_class_ref(WEBKIT_TYPE_COOKIE_ACCEPT_POLICY);
@@ -827,7 +832,7 @@
         return 0;
     }
 
-    GtkApplication *application = gtk_application_new(NULL, G_APPLICATION_FLAGS_NONE);
+    GtkApplication *application = gtk_application_new("org.webkitgtk.MiniBrowser", G_APPLICATION_NON_UNIQUE);
     g_signal_connect(application, "startup", G_CALLBACK(startup), NULL);
     g_signal_connect(application, "activate", G_CALLBACK(activate), webkitSettings);
     g_application_run(G_APPLICATION(application), 0, NULL);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to