mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb/Loader: Add filtering_enabled flag in ContentFilter
This allows us to toggle content filtering on or off. Default is set to true to match current behavior.
This commit is contained in:
parent
a6efdb1068
commit
00aa72c16e
|
|
@ -21,6 +21,9 @@ ContentFilter::~ContentFilter() = default;
|
|||
|
||||
bool ContentFilter::is_filtered(const URL::URL& url) const
|
||||
{
|
||||
if (!filtering_enabled())
|
||||
return false;
|
||||
|
||||
if (url.scheme() == "data")
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ class ContentFilter {
|
|||
public:
|
||||
static ContentFilter& the();
|
||||
|
||||
bool filtering_enabled() const { return m_filtering_enabled; }
|
||||
void set_filtering_enabled(bool const enabled) { m_filtering_enabled = enabled; }
|
||||
|
||||
bool is_filtered(const URL::URL&) const;
|
||||
ErrorOr<void> set_patterns(ReadonlySpan<String>);
|
||||
|
||||
|
|
@ -27,6 +30,7 @@ private:
|
|||
String text;
|
||||
};
|
||||
Vector<Pattern> m_patterns;
|
||||
bool m_filtering_enabled { true };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user