<!-- Version 0.6. -->
<sect1 id="version_0.6">
- <title>0.6 - 15 July 2024</title>
+ <title><ulink url="https://www.stoutner.com/privacy-browser-pc-0-6/">0.6</ulink> -
+ <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=dd08da27e3e1cae734790cae8e3b8626fdf40c4b;ds=sidebyside">15 July 2024</ulink></title>
<itemizedlist>
<listitem><para>Add <ulink url="https://redmine.stoutner.com/issues/969">filter lists</ulink>.</para></listitem>
// Define the public user agent constants.
const QString UserAgentHelper::PRIVACY_BROWSER_USER_AGENT = QLatin1String("PrivacyBrowser/1.0");
const QString UserAgentHelper::FIREFOX_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0");
-const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
+const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QLatin1String("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36");
const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0");
const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36");
const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QLatin1String("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0");
break;
}
}
+ }
- // Handle the request according to the navigation type.
- switch (urlRequestInfo.navigationType())
+ // Handle the request according to the navigation type.
+ switch (urlRequestInfo.navigationType())
+ {
+ case QWebEngineUrlRequestInfo::NavigationTypeLink:
+ case QWebEngineUrlRequestInfo::NavigationTypeTyped:
+ case QWebEngineUrlRequestInfo::NavigationTypeBackForward:
+ // case QWebEngineUrlRequestInfo::NavigationTypeReload: This can be uncommented once https://redmine.stoutner.com/issues/821 has been fixed.
+ case QWebEngineUrlRequestInfo::NavigationTypeRedirect:
{
- case QWebEngineUrlRequestInfo::NavigationTypeLink:
- case QWebEngineUrlRequestInfo::NavigationTypeTyped:
- case QWebEngineUrlRequestInfo::NavigationTypeBackForward:
- // case QWebEngineUrlRequestInfo::NavigationTypeReload: This can be uncommented once https://redmine.stoutner.com/issues/821 has been fixed.
- case QWebEngineUrlRequestInfo::NavigationTypeRedirect:
+ // Only check the hosts if the main URL is changing.
+ if (urlRequestInfo.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame)
{
- // Only check the hosts if the main URL is changing.
- if (urlRequestInfo.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame)
- {
- // Get the hosts.
- QString requestingHost = urlRequestInfo.initiator().host();
- QString requestedHost = urlRequestInfo.requestUrl().host();
-
- // Reapply the domain settings if the host is changing.
- if (requestingHost != requestedHost)
- emit applyDomainSettings(requestedHost);
- }
+ // Get the hosts.
+ QString requestingHost = urlRequestInfo.initiator().host();
+ QString requestedHost = urlRequestInfo.requestUrl().host();
- break;
+ // Reapply the domain settings if the host is changing.
+ if (requestingHost != requestedHost)
+ emit applyDomainSettings(requestedHost);
}
- default:
- // Do nothing.
- break;
+ break;
}
+
+ default:
+ // Do nothing.
+ break;
}
// Send the request struct to the privacy WebEngine view.
target_sources(privacybrowser PRIVATE
DevToolsWebEngineView.cpp
DraggableTreeView.cpp
+ PrivacyWebEnginePage.cpp
PrivacyWebEngineView.cpp
TabWidget.cpp
UrlLineEdit.cpp
--- /dev/null
+/*
+ * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
+ *
+ * Privacy Browser PC is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser PC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Application headers.
+#include "PrivacyWebEnginePage.h"
+
+// Construct the class.
+PrivacyWebEnginePage::PrivacyWebEnginePage(QWebEngineProfile *webEngineProfilePointer, QObject *parentObjectPointer) : QWebEnginePage(webEngineProfilePointer, parentObjectPointer) {}
+
--- /dev/null
+/*
+ * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
+ *
+ * Privacy Browser PC is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser PC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PRIVACY_WEBENGINE_PAGE_H
+#define PRIVACY_WEBENGINE_PAGE_H
+
+// Qt toolkit headers.
+#include <QWebEnginePage>
+
+class PrivacyWebEnginePage : public QWebEnginePage
+{
+ // Include the Q_OBJECT macro.
+ Q_OBJECT
+
+public:
+ // The default constructor.
+ explicit PrivacyWebEnginePage(QWebEngineProfile *webEngineProfilePointer, QObject *parentObjectPointer = nullptr);
+
+//protected:
+};
+#endif
// Application headers.
#include "PrivacyWebEngineView.h"
+#include "PrivacyWebEnginePage.h"
#include "Settings.h"
#include "ui_HttpAuthenticationDialog.h"
#include "databases/CookiesDatabase.h"
webEngineProfilePointer = new QWebEngineProfile(QLatin1String(""));
// Create a WebEngine page.
- QWebEnginePage *webEnginePagePointer = new QWebEnginePage(webEngineProfilePointer);
+ PrivacyWebEnginePage *privacyWebEnginePagePointer = new PrivacyWebEnginePage(webEngineProfilePointer);
// Set the WebEngine page.
- setPage(webEnginePagePointer);
+ setPage(privacyWebEnginePagePointer);
// Get handles for the various aspects of the WebEngine.
- webEngineSettingsPointer = webEnginePagePointer->settings();
+ webEngineSettingsPointer = privacyWebEnginePagePointer->settings();
// Instantiate the URL request interceptor.
UrlRequestInterceptor *urlRequestInterceptorPointer = new UrlRequestInterceptor(this);
connect(urlRequestInterceptorPointer, SIGNAL(requestProcessed(RequestStruct*)), this, SLOT(storeRequest(RequestStruct*)));
// Handle HTTP authentication requests.
- connect(webEnginePagePointer, SIGNAL(authenticationRequired(const QUrl&, QAuthenticator*)), this, SLOT(handleAuthenticationRequest(const QUrl&, QAuthenticator*)));
+ connect(privacyWebEnginePagePointer, SIGNAL(authenticationRequired(const QUrl&, QAuthenticator*)), this, SLOT(handleAuthenticationRequest(const QUrl&, QAuthenticator*)));
}
void PrivacyWebEngineView::addCookieToList(const QNetworkCookie &cookie) const