Bläddra i källkod

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.
Sam Atkins 3 år sedan
förälder
incheckning
d36e3af7be
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      Userland/Libraries/LibWeb/Loader/ContentFilter.cpp

+ 3 - 0
Userland/Libraries/LibWeb/Loader/ContentFilter.cpp

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