summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/WebSocket.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-01 18:39:03 +0300
committerAndreas Kling <kling@serenityos.org>2021-10-01 20:14:45 +0200
commitd44857d34d0aebef52374297b846304321d355ac (patch)
tree5b5b1a69fe7215479c37157490b4da079c01b664 /Userland/Libraries/LibWeb/HTML/WebSocket.cpp
parent9863de4609d81a0c6b97556e13f2bc19c2c8c449 (diff)
downloadserenity-d44857d34d0aebef52374297b846304321d355ac.zip
LibWeb: Add the missing MessageEvent IDL constructor
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/WebSocket.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/WebSocket.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/WebSocket.cpp b/Userland/Libraries/LibWeb/HTML/WebSocket.cpp
index a73df59177..5094174577 100644
--- a/Userland/Libraries/LibWeb/HTML/WebSocket.cpp
+++ b/Userland/Libraries/LibWeb/HTML/WebSocket.cpp
@@ -203,7 +203,10 @@ void WebSocket::on_message(ByteBuffer message, bool is_text)
return;
if (is_text) {
auto text_message = String(ReadonlyBytes(message));
- dispatch_event(MessageEvent::create(EventNames::message, JS::js_string(wrapper()->vm(), text_message), url()));
+ MessageEventInit event_init {};
+ event_init.data = JS::js_string(wrapper()->vm(), text_message);
+ event_init.origin = url();
+ dispatch_event(MessageEvent::create(EventNames::message, event_init));
return;
}
// type indicates that the data is Binary and binaryType is "blob"