[geary/mjog/webkit-sandbox-print-to-pdf] Components.WebView: Fix printing to PDF with WebKitGTK sandbox enabled




commit 5a54e470b207b3207d84c5d53f3b101a98e95bf4
Author: Michael Gratton <mike vee net>
Date:   Wed Feb 3 23:28:15 2021 +1100

    Components.WebView: Fix printing to PDF with WebKitGTK sandbox enabled
    
    Add all of `~` as writable to the sandbox so it can actually write the
    PDF.

 src/client/components/components-web-view.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/client/components/components-web-view.vala b/src/client/components/components-web-view.vala
index 6896a6b83..a45d24223 100644
--- a/src/client/components/components-web-view.vala
+++ b/src/client/components/components-web-view.vala
@@ -81,6 +81,9 @@ public abstract class Components.WebView : WebKit.WebView, Geary.BaseInterface {
         WebKit.WebContext context = new WebKit.WebContext.with_website_data_manager(data_manager);
         // 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.


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