summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/WebContent/ClientConnection.cpp7
-rw-r--r--Userland/Services/WebContent/ClientConnection.h1
-rw-r--r--Userland/Services/WebContent/WebContentClient.ipc1
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc1
4 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp
index 74c4efb678..88a3bf713e 100644
--- a/Userland/Services/WebContent/ClientConnection.cpp
+++ b/Userland/Services/WebContent/ClientConnection.cpp
@@ -209,4 +209,11 @@ void ClientConnection::handle(const Messages::WebContentServer::DebugRequest& me
}
}
+void ClientConnection::handle(const Messages::WebContentServer::GetSource&)
+{
+ if (auto* doc = page().main_frame().document()) {
+ post_message(Messages::WebContentClient::DidGetSource(doc->url(), doc->source()));
+ }
+}
+
}
diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h
index 9ea691ae49..123f270f8d 100644
--- a/Userland/Services/WebContent/ClientConnection.h
+++ b/Userland/Services/WebContent/ClientConnection.h
@@ -64,6 +64,7 @@ private:
virtual void handle(const Messages::WebContentServer::AddBackingStore&) override;
virtual void handle(const Messages::WebContentServer::RemoveBackingStore&) override;
virtual void handle(const Messages::WebContentServer::DebugRequest&) override;
+ virtual void handle(const Messages::WebContentServer::GetSource&) override;
void flush_pending_paint_requests();
diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc
index 9ca013cd1e..32a9c9a854 100644
--- a/Userland/Services/WebContent/WebContentClient.ipc
+++ b/Userland/Services/WebContent/WebContentClient.ipc
@@ -17,4 +17,5 @@ endpoint WebContentClient = 90
DidRequestAlert(String message) => ()
DidRequestConfirm(String message) => (bool result)
DidRequestPrompt(String message, String default_) => (String response)
+ DidGetSource(URL url, String source) =|
}
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index 3debce25d8..de36e4f07b 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -21,4 +21,5 @@ endpoint WebContentServer = 89
KeyDown(i32 key, unsigned modifiers, u32 code_point) =|
DebugRequest(String request, String argument) =|
+ GetSource() =|
}