From 09a3bcf0f03a86bc9caa7c4b5e7770e5f3306a5c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 20 Mar 2025 06:41:00 +0100 Subject: [PATCH] fix: `webContents.print()` crash on Linux (#46087) --- shell/browser/feature_list.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/shell/browser/feature_list.cc b/shell/browser/feature_list.cc index f063fbef926b..a4be79d37e98 100644 --- a/shell/browser/feature_list.cc +++ b/shell/browser/feature_list.cc @@ -27,6 +27,10 @@ #include "pdf/pdf_features.h" #endif +#if BUILDFLAG(IS_LINUX) +#include "printing/printing_features.h" +#endif + namespace electron { void InitializeFeatureList() { @@ -56,6 +60,14 @@ void InitializeFeatureList() { std::string(",") + features::kMacWebContentsOcclusion.name; #endif +#if BUILDFLAG(IS_LINUX) + disable_features += + // EnableOopPrintDrivers is still a bit half-baked on Linux and + // causes crashes when trying to show dialogs. + // TODO(codebytere): figure out how to re-enable this with our patches. + std::string(",") + printing::features::kEnableOopPrintDrivers.name; +#endif + #if BUILDFLAG(ENABLE_PDF_VIEWER) // Enable window.showSaveFilePicker api for saving pdf files. // Refs https://issues.chromium.org/issues/373852607