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:
parent
e511a264fe
commit
947136ca8d
Notes:
sideshowbarker
2024-07-17 02:39:10 +09:00
Author: https://github.com/trflynn89
Commit: 947136ca8d
Pull-request: https://github.com/SerenityOS/serenity/pull/22411
1 changed files with 2 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue