mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibWeb: Add the missing MessageEvent IDL constructor
This commit is contained in:
parent
9863de4609
commit
d44857d34d
4 changed files with 36 additions and 8 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue