LibWeb: Don't try to ad-block data: urls

In some cases these can be several KiB or more in size, making checking
very slow, and it doesn't make sense to filter them out anyway. This
change speeds up loading pages with large data: urls, which previously
took up to 1ms per byte to process.
This commit is contained in:
Sam Atkins 2021-09-27 14:59:42 +01:00 committed by Andreas Kling
parent a79bdd2bd5
commit d36e3af7be
Notes: sideshowbarker 2024-07-18 03:24:48 +09:00

View file

@ -25,6 +25,9 @@ ContentFilter::~ContentFilter()
bool ContentFilter::is_filtered(const AK::URL& url) const
{
if (url.protocol() == "data")
return false;
auto url_string = url.to_string();
for (auto& pattern : m_patterns) {