mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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:
parent
a79bdd2bd5
commit
d36e3af7be
Notes:
sideshowbarker
2024-07-18 03:24:48 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/d36e3af7beb Pull-request: https://github.com/SerenityOS/serenity/pull/10228
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue