mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
AdBlockRule: Correctly disable third-party option
This commit is contained in:
parent
4efbc54cac
commit
6b02cd4cab
@ -224,10 +224,12 @@ bool AdBlockRule::networkMatch(const QWebEngineUrlRequestInfo &request, const QS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QTWEBENGINE_DISABLED
|
||||||
// Check third-party restriction
|
// Check third-party restriction
|
||||||
if (hasOption(ThirdPartyOption) && !matchThirdParty(request)) {
|
if (hasOption(ThirdPartyOption) && !matchThirdParty(request)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Check object restrictions
|
// Check object restrictions
|
||||||
if (hasOption(ObjectOption) && !matchObject(request)) {
|
if (hasOption(ObjectOption) && !matchObject(request)) {
|
||||||
@ -434,11 +436,13 @@ void AdBlockRule::parseFilter()
|
|||||||
m_caseSensitivity = Qt::CaseSensitive;
|
m_caseSensitivity = Qt::CaseSensitive;
|
||||||
++handledOptions;
|
++handledOptions;
|
||||||
}
|
}
|
||||||
|
#if QTWEBENGINE_DISABLED
|
||||||
else if (option.endsWith(QL1S("third-party"))) {
|
else if (option.endsWith(QL1S("third-party"))) {
|
||||||
setOption(ThirdPartyOption);
|
setOption(ThirdPartyOption);
|
||||||
setException(ThirdPartyOption, option.startsWith(QL1C('~')));
|
setException(ThirdPartyOption, option.startsWith(QL1C('~')));
|
||||||
++handledOptions;
|
++handledOptions;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (option.endsWith(QL1S("object"))) {
|
else if (option.endsWith(QL1S("object"))) {
|
||||||
setOption(ObjectOption);
|
setOption(ObjectOption);
|
||||||
setException(ObjectOption, option.startsWith(QL1C('~')));
|
setException(ObjectOption, option.startsWith(QL1C('~')));
|
||||||
|
Loading…
Reference in New Issue
Block a user