+ // Get the domain record.
+ QSqlRecord domainRecord = domainQuery.record();
+
+ // Set the JavaScript status.
+ switch (domainRecord.field(DomainsDatabase::JAVASCRIPT).value().toInt())
+ {
+ // Set the default JavaScript status.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
+
+ break;
+ }
+
+ // Disable JavaScript.
+ case (DomainsDatabase::DISABLED):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
+
+ break;
+ }
+
+ // Enable JavaScript.
+ case (DomainsDatabase::ENABLED):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+
+ break;
+ }
+ }
+
+ // Set the local storage status.
+ switch (domainRecord.field(DomainsDatabase::LOCAL_STORAGE).value().toInt())
+ {
+ // Set the default local storage status.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ currentPrivacyWebEnginePointer->localStorageEnabled = Settings::localStorageEnabled();
+
+ break;
+ }
+
+ // Disable local storage.
+ case (DomainsDatabase::DISABLED):
+ {
+ currentPrivacyWebEnginePointer->localStorageEnabled = false;
+
+ break;
+ }
+
+ // Enable local storage.
+ case (DomainsDatabase::ENABLED):
+ {
+ currentPrivacyWebEnginePointer->localStorageEnabled = true;
+
+ break;
+ }
+ }
+
+ // Set the DOM storage status.
+ switch (domainRecord.field(DomainsDatabase::DOM_STORAGE).value().toInt())
+ {
+ // Set the default DOM storage status.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
+
+ break;
+ }
+
+ // Disable DOM storage.
+ case (DomainsDatabase::DISABLED):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
+
+ break;
+ }
+
+ // Enable DOM storage.
+ case (DomainsDatabase::ENABLED):
+ {
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
+
+ break;
+ }
+ }
+
+ // Set the user agent.
+ webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getResultingDomainSettingsUserAgent(domainRecord.field(DomainsDatabase::USER_AGENT).value().toString()));
+
+ // Check if a custom zoom factor is set.
+ if (domainRecord.field(DomainsDatabase::ZOOM_FACTOR).value().toInt())
+ {
+ // Store the current zoom factor.
+ currentZoomFactor = domainRecord.field(DomainsDatabase::CUSTOM_ZOOM_FACTOR).value().toDouble();
+ }
+ else
+ {
+ // Reset the current zoom factor.
+ currentZoomFactor = Settings::zoomFactor();
+ }
+
+ // Set the zoom factor. The use of `currentZoomFactor` can be removed once <https://redmine.stoutner.com/issues/799> has been resolved.
+ webEngineViewPointer->setZoomFactor(currentZoomFactor);
+
+ // Apply the domain settings palette to the URL line edit.
+ emit updateDomainSettingsIndicator(true, domainRecord.field(DomainsDatabase::DOMAIN_NAME).value().toString());