fix: webContents.print() crash on Linux (#46087)

This commit is contained in:
Shelley Vohr 2025-03-20 06:41:00 +01:00 committed by GitHub
parent bf64967b68
commit 09a3bcf0f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,6 +27,10 @@
#include "pdf/pdf_features.h" #include "pdf/pdf_features.h"
#endif #endif
#if BUILDFLAG(IS_LINUX)
#include "printing/printing_features.h"
#endif
namespace electron { namespace electron {
void InitializeFeatureList() { void InitializeFeatureList() {
@ -56,6 +60,14 @@ void InitializeFeatureList() {
std::string(",") + features::kMacWebContentsOcclusion.name; std::string(",") + features::kMacWebContentsOcclusion.name;
#endif #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) #if BUILDFLAG(ENABLE_PDF_VIEWER)
// Enable window.showSaveFilePicker api for saving pdf files. // Enable window.showSaveFilePicker api for saving pdf files.
// Refs https://issues.chromium.org/issues/373852607 // Refs https://issues.chromium.org/issues/373852607