1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:17:34 +00: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

View file

@ -8,7 +8,6 @@
#include <AK/JsonArray.h> #include <AK/JsonArray.h>
#include <AK/JsonObject.h> #include <AK/JsonObject.h>
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibCore/Resource.h>
#include <LibJS/MarkupGenerator.h> #include <LibJS/MarkupGenerator.h>
#include <LibWeb/Infra/Strings.h> #include <LibWeb/Infra/Strings.h>
#include <LibWebView/InspectorClient.h> #include <LibWebView/InspectorClient.h>
@ -340,10 +339,6 @@ void InspectorClient::load_inspector()
{ {
StringBuilder builder; 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"~~~( builder.append(R"~~~(
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -353,10 +348,10 @@ void InspectorClient::load_inspector()
)~~~"sv); )~~~"sv);
builder.append(HTML_HIGHLIGHTER_STYLE); builder.append(HTML_HIGHLIGHTER_STYLE);
builder.append(inspector_css->data());
builder.append(R"~~~( builder.append(R"~~~(
</style> </style>
<link href="resource://ladybird/inspector.css" rel="stylesheet" />
</head> </head>
<body> <body>
<div class="split-view"> <div class="split-view">
@ -424,13 +419,7 @@ void InspectorClient::load_inspector()
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript" src="resource://ladybird/inspector.js"></script>
)~~~"sv);
builder.append(inspector_js->data());
builder.append(R"~~~(
</script>
</body> </body>
</html> </html>
)~~~"sv); )~~~"sv);