[geary/gnumdk/sanbox: 1/2] Revert "Components.WebView: Disable WebKitGTK sandboxing again"




commit f4e1b19727cd7f0275132c774a216708541db398
Author: Cédric Bellegarde <cedric bellegarde adishatz org>
Date:   Wed Oct 19 09:02:44 2022 +0200

    Revert "Components.WebView: Disable WebKitGTK sandboxing again"
    
    This reverts commit a5ce9d84343a8b9bac03dcf3ef7aee90f9fd2b1b.

 src/client/components/components-web-view.vala | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/client/components/components-web-view.vala b/src/client/components/components-web-view.vala
index 4ec857f92..cfedc9a96 100644
--- a/src/client/components/components-web-view.vala
+++ b/src/client/components/components-web-view.vala
@@ -80,16 +80,12 @@ public abstract class Components.WebView : WebKit.WebView, Geary.BaseInterface {
                                         File cache_dir) {
         WebsiteDataManager data_manager = new WebsiteDataManager(cache_dir.get_path());
         WebKit.WebContext context = new WebKit.WebContext.with_website_data_manager(data_manager);
-
-        // WebProcess sandboxing
-        //
-        // The sandbox is currently disabled since it breaks printing
-        // and saving as PDF. See:
-        // https://bugs.webkit.org/show_bug.cgi?id=202363
-        //
-        // context.add_path_to_sandbox(web_extension_dir.get_path(), true);
-        // context.set_sandbox_enabled(true);
-
+        // Enable WebProcess sandboxing
+        context.add_path_to_sandbox(web_extension_dir.get_path(), true);
+        // Add the whole home directory otherwise print-to-PDF won't work.
+        // See https://bugs.webkit.org/show_bug.cgi?id=202363
+        context.add_path_to_sandbox(GLib.Environment.get_home_dir(), false);
+        context.set_sandbox_enabled(true);
         // Use the doc browser model so that we get some caching of
         // resources between email body loads.
         context.set_cache_model(WebKit.CacheModel.DOCUMENT_BROWSER);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]