mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
AdBlock: Add support for parsing CSS Element hiding exceptions
Those rules are however not supported at the moment.
This commit is contained in:
parent
6dcf8c598a
commit
ed866dc9a4
@ -374,9 +374,9 @@ void AdBlockRule::parseFilter()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CSS Element hiding rule
|
// CSS Element hiding rule
|
||||||
if (parsedLine.contains(QL1S("##"))) {
|
if (parsedLine.contains(QL1S("##")) || parsedLine.contains(QL1S("#@#"))) {
|
||||||
m_type = CssRule;
|
m_type = CssRule;
|
||||||
int pos = parsedLine.indexOf(QL1S("##"));
|
int pos = parsedLine.indexOf(QL1C('#'));
|
||||||
|
|
||||||
// Domain restricted rule
|
// Domain restricted rule
|
||||||
if (!parsedLine.startsWith(QL1S("##"))) {
|
if (!parsedLine.startsWith(QL1S("##"))) {
|
||||||
@ -384,7 +384,15 @@ void AdBlockRule::parseFilter()
|
|||||||
parseDomains(domains, QL1C(','));
|
parseDomains(domains, QL1C(','));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_matchString = parsedLine.mid(pos + 2);
|
m_isException = parsedLine.at(pos + 1) == QL1C('@');
|
||||||
|
m_matchString = parsedLine.mid(m_isException ? pos + 3 : pos + 2);
|
||||||
|
|
||||||
|
// CSS Element hiding exceptions not supported for now
|
||||||
|
if (m_isException) {
|
||||||
|
m_isInternalDisabled = true;
|
||||||
|
m_type = Invalid;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// CSS rule cannot have more options -> stop parsing
|
// CSS rule cannot have more options -> stop parsing
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user