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

AdBlockRule: Correctly disable third-party option

This commit is contained in:
David Rosca 2015-10-06 10:13:01 +02:00
parent 4efbc54cac
commit 6b02cd4cab

View File

@ -224,10 +224,12 @@ bool AdBlockRule::networkMatch(const QWebEngineUrlRequestInfo &request, const QS
return false;
}
#if QTWEBENGINE_DISABLED
// Check third-party restriction
if (hasOption(ThirdPartyOption) && !matchThirdParty(request)) {
return false;
}
#endif
// Check object restrictions
if (hasOption(ObjectOption) && !matchObject(request)) {
@ -434,11 +436,13 @@ void AdBlockRule::parseFilter()
m_caseSensitivity = Qt::CaseSensitive;
++handledOptions;
}
#if QTWEBENGINE_DISABLED
else if (option.endsWith(QL1S("third-party"))) {
setOption(ThirdPartyOption);
setException(ThirdPartyOption, option.startsWith(QL1C('~')));
++handledOptions;
}
#endif
else if (option.endsWith(QL1S("object"))) {
setOption(ObjectOption);
setException(ObjectOption, option.startsWith(QL1C('~')));