/*
- * Copyright 2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2022-2023 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
*
return false;
});
- // Disable JavaScript by default (this prevetns JavaScript from being enabled on a new tab before domain settings are loaded).
+ // Disable JavaScript by default (this prevents JavaScript from being enabled on a new tab before domain settings are loaded).
webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
// Don't allow JavaScript to open windows.
// Limit WebRTC to public IP addresses.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::WebRTCPublicInterfacesOnly, true);
+ // Enable the PDF viewer (it should be enabled by default, but it is nice to be explicit in case the defaults change).
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::PdfViewerEnabled, true);
+
+ // Plugins must be enabled for the PDF viewer to work. <https://doc.qt.io/qt-5/qtwebengine-features.html#pdf-file-viewing>
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+
// Update the cookies action.
connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::updateCookiesAction, [privacyWebEngineViewPointer, this] (const int numberOfCookies)
{