1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

[QtWebKit 2.3] Enable 3rd party cookie policy.

This commit is contained in:
nowrep 2013-01-09 19:12:42 +01:00
parent 6bf53c0332
commit a0203c3fbb
2 changed files with 5 additions and 2 deletions

View File

@ -24,6 +24,7 @@
#include <QWebSettings>
#include <QDateTime>
#include <QDebug>
#include <QWebPage> // QTWEBKIT_VERSION_CHECK macro
//#define COOKIE_DEBUG
@ -97,7 +98,7 @@ void CookieJar::loadSettings()
m_blacklist = settings.value("blacklist", QStringList()).toStringList();
settings.endGroup();
#if QT_VERSION >= 0x050000
#if QT_VERSION >= 0x050000 || (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 3, 0))
mApp->webSettings()->setThirdPartyCookiePolicy(m_blockThirdParty ?
QWebSettings::AlwaysBlockThirdPartyCookies :
QWebSettings::AlwaysAllowThirdPartyCookies);
@ -136,7 +137,7 @@ bool CookieJar::rejectCookie(const QString &domain, const QNetworkCookie &cookie
}
// This feature is now natively in QtWebKit in Qt 5
#if QT_VERSION < 0x050000
#if QT_VERSION < 0x050000 && (QTWEBKIT_VERSION < QTWEBKIT_VERSION_CHECK(2, 3, 0))
if (m_blockThirdParty) {
bool result = blockThirdParty(cookieDomain, domain);
if (result) {

View File

@ -20,6 +20,8 @@
#include "globalfunctions.h"
#include "settings.h"
#include <QWebPage> // QTWEBKIT_VERSION_CHECK macro
UserAgentManager::UserAgentManager()
{
m_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(qz_buildSystem(), QupZilla::WEBKITVERSION);