Skip to content

Truly independent web browser

LibWebView: Let a blocked resource own the name of its kind

Andreas Klingc0e93e7d3194
diff --git a/Libraries/LibWebView/ContentBlocking.h b/Libraries/LibWebView/ContentBlocking.h
index 14b25f7d6c8..4fb5d56f184 100644
--- a/Libraries/LibWebView/ContentBlocking.h
+++ b/Libraries/LibWebView/ContentBlocking.h
@@ -25,7 +25,7 @@ enum class ContentBlockingState : u8 {
// a script or an image.
struct BlockedResource {
String host;
- StringView kind;
+ String kind;
};
struct ContentBlockingSnapshot {
diff --git a/Libraries/LibWebView/ViewImplementation.cpp b/Libraries/LibWebView/ViewImplementation.cpp
index 5771d1e0c4e..d90a41d2af5 100644
--- a/Libraries/LibWebView/ViewImplementation.cpp
+++ b/Libraries/LibWebView/ViewImplementation.cpp
@@ -2708,7 +2708,7 @@ void ViewImplementation::did_block_resource(Badge<WebContentPage>, URL::URL cons
if (host.is_empty() || is_listed)
return;
- m_blocked_resources.append({ move(host), resource_kind });
+ m_blocked_resources.append({ move(host), MUST(String::from_utf8(resource_kind)) });
notify_content_blocking_changed();
}