#include <QMenu>
// Construct the class.
-PrivacyWebEngineView::PrivacyWebEngineView() : QWebEngineView(nullptr)
+PrivacyWebEngineView::PrivacyWebEngineView(QWidget *parentWidgetPointer) : QWebEngineView(parentWidgetPointer)
{
// Create an off-the-record profile (the default when no profile name is specified).
webEngineProfilePointer = new QWebEngineProfile(QLatin1String(""));
webEngineSettingsPointer = webEnginePagePointer->settings();
// Instantiate the URL request interceptor.
- UrlRequestInterceptor *urlRequestInterceptorPointer = new UrlRequestInterceptor();
+ UrlRequestInterceptor *urlRequestInterceptorPointer = new UrlRequestInterceptor(this);
// Set the URL request interceptor.
webEngineProfilePointer->setUrlRequestInterceptor(urlRequestInterceptorPointer);
if (domainQuery.value(DomainsDatabase::ZOOM_FACTOR).toInt())
{
// Store the current zoom factor.
- setZoomFactor(domainQuery.value(DomainsDatabase::CUSTOM_ZOOM_FACTOR).toDouble());
+ defaultZoomFactor = domainQuery.value(DomainsDatabase::CUSTOM_ZOOM_FACTOR).toDouble();
}
else
{
- // Reset the current zoom factor.
- setZoomFactor(Settings::zoomFactor());
+ // Store the current zoom factor.
+ defaultZoomFactor = Settings::zoomFactor();
}
}
else // The hostname does not have domain settings.
// Set the user agent.
webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()));
- // Set the zoom factor.
- setZoomFactor(Settings::zoomFactor());
+ // Store the zoom factor.
+ defaultZoomFactor = Settings::zoomFactor();
}
+ // Set the current zoom factor.
+ setZoomFactor(defaultZoomFactor);
+
// Reload the website if requested.
if (reloadWebsite)
reload();