diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 919fc74a6..88d78709b 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -976,6 +976,7 @@ void MainApplication::loadSettings() #if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 13, 0) webSettings->setAttribute(QWebEngineSettings::PdfViewerEnabled, settings.value(QSL("intPDFViewer"), false).toBool()); + webSettings->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, settings.value(QSL("screenCaptureEnabled"), false).toBool()); #endif webSettings->setDefaultTextEncoding(settings.value(QSL("DefaultEncoding"), webSettings->defaultTextEncoding()).toString()); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index f3e6f1a05..3e89d8866 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -123,8 +123,10 @@ Preferences::Preferences(BrowserWindow* window) #if QTWEBENGINEWIDGETS_VERSION < QT_VERSION_CHECK(5, 13, 0) ui->intPDFViewer->setVisible(false); + ui->screenCaptureEnabled->setVisible(false); #endif + auto setCategoryIcon = [this](int index, const QIcon &icon) { ui->listWidget->item(index)->setIcon(QIcon(icon.pixmap(32))); }; @@ -302,6 +304,7 @@ Preferences::Preferences(BrowserWindow* window) ui->dnsPrefetch->setChecked(settings.value("DNSPrefetch", true).toBool()); ui->intPDFViewer->setChecked(settings.value("intPDFViewer", false).toBool()); ui->intPDFViewer->setEnabled(ui->allowPlugins->isChecked()); + ui->screenCaptureEnabled->setChecked(settings.value("screenCaptureEnabled", false).toBool()); const auto levels = WebView::zoomLevels(); for (int level : levels) { @@ -972,6 +975,7 @@ void Preferences::saveSettings() settings.setValue("WebRTCPublicIpOnly", ui->webRTCPublicIpOnly->isChecked()); settings.setValue("DNSPrefetch", ui->dnsPrefetch->isChecked()); settings.setValue("intPDFViewer", ui->intPDFViewer->isChecked()); + settings.setValue("screenCaptureEnabled", ui->screenCaptureEnabled->isChecked()); #ifdef Q_OS_WIN settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked()); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 215d4fccd..b02e84bf0 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -1089,6 +1089,13 @@ + + + + Enable screen capture + + +