mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
[Acid3] Make Acid3 test pass with enabled AdBlock.
AdBlock element hiding rules are inserted into body element of page. This does not like the Acid3 test.
This commit is contained in:
parent
39e6e1a0f1
commit
a65d7b00b3
@ -313,7 +313,7 @@ void AdBlockManager::save()
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdBlockManager::isEnabled()
|
bool AdBlockManager::isEnabled() const
|
||||||
{
|
{
|
||||||
return m_enabled;
|
return m_enabled;
|
||||||
}
|
}
|
||||||
@ -353,6 +353,15 @@ QString AdBlockManager::elementHidingRules() const
|
|||||||
|
|
||||||
QString AdBlockManager::elementHidingRulesForDomain(const QUrl &url) const
|
QString AdBlockManager::elementHidingRulesForDomain(const QUrl &url) const
|
||||||
{
|
{
|
||||||
|
if (!isEnabled() || !canRunOnScheme(url.scheme())) {
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Acid3 doesn't like the way element hiding rules are embedded into page
|
||||||
|
if (url.host() == QLatin1String("acid3.acidtests.org")) {
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
QString rules;
|
QString rules;
|
||||||
|
|
||||||
foreach (AdBlockSubscription* subscription, m_subscriptions) {
|
foreach (AdBlockSubscription* subscription, m_subscriptions) {
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
|
||||||
bool isEnabled();
|
bool isEnabled() const;
|
||||||
bool canRunOnScheme(const QString &scheme) const;
|
bool canRunOnScheme(const QString &scheme) const;
|
||||||
|
|
||||||
QString elementHidingRules() const;
|
QString elementHidingRules() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user