1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibWebView: Load the Inspector CSS and JS resource files with LibWeb

This commit is contained in:
Timothy Flynn 2023-12-23 15:44:04 -05:00 committed by Andreas Kling
parent e511a264fe
commit 947136ca8d
Notes: sideshowbarker 2024-07-17 02:39:10 +09:00

View file

@ -8,7 +8,6 @@
#include <AK/JsonArray.h>
#include <AK/JsonObject.h>
#include <AK/StringBuilder.h>
#include <LibCore/Resource.h>
#include <LibJS/MarkupGenerator.h>
#include <LibWeb/Infra/Strings.h>
#include <LibWebView/InspectorClient.h>
@ -340,10 +339,6 @@ void InspectorClient::load_inspector()
{
StringBuilder builder;
// FIXME: Teach LibWeb how to load resource:// URIs instead of needing to read these files here.
auto inspector_css = MUST(Core::Resource::load_from_uri("resource://ladybird/inspector.css"sv));
auto inspector_js = MUST(Core::Resource::load_from_uri("resource://ladybird/inspector.js"sv));
builder.append(R"~~~(
<!DOCTYPE html>
<html>
@ -353,10 +348,10 @@ void InspectorClient::load_inspector()
)~~~"sv);
builder.append(HTML_HIGHLIGHTER_STYLE);
builder.append(inspector_css->data());
builder.append(R"~~~(
</style>
<link href="resource://ladybird/inspector.css" rel="stylesheet" />
</head>
<body>
<div class="split-view">
@ -424,13 +419,7 @@ void InspectorClient::load_inspector()
</div>
</div>
<script type="text/javascript">
)~~~"sv);
builder.append(inspector_js->data());
builder.append(R"~~~(
</script>
<script type="text/javascript" src="resource://ladybird/inspector.js"></script>
</body>
</html>
)~~~"sv);