1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Browser+Ladybird+LibWeb: Port content filters to String

This commit is contained in:
Timothy Flynn 2023-04-21 07:54:56 -04:00 committed by Andreas Kling
parent 76ae60da15
commit 5089766af6
11 changed files with 23 additions and 22 deletions

View file

@ -126,14 +126,15 @@ static ErrorOr<void> load_content_filters()
auto ad_filter_list = TRY(Core::BufferedFile::create(move(file)));
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
Vector<DeprecatedString> patterns;
Vector<String> patterns;
while (TRY(ad_filter_list->can_read_line())) {
auto line = TRY(ad_filter_list->read_line(buffer));
if (line.is_empty())
continue;
TRY(patterns.try_append(line));
auto pattern = TRY(String::from_utf8(line));
TRY(patterns.try_append(move(pattern)));
}
auto& content_filter = Web::ContentFilter::the();