瀏覽代碼

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 年之前
父節點
當前提交
d36e3af7be
共有 1 個文件被更改,包括 3 次插入0 次删除
  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
 {
+    if (url.protocol() == "data")
+        return false;
+
     auto url_string = url.to_string();
 
     for (auto& pattern : m_patterns) {