mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Properly set the origin on websocket messages
This commit is contained in:
parent
89ab110357
commit
a1925aab52
6 changed files with 17 additions and 17 deletions
|
@ -82,14 +82,15 @@ impl MessageEvent {
|
|||
impl MessageEvent {
|
||||
pub fn dispatch_jsval(target: &EventTarget,
|
||||
scope: &GlobalScope,
|
||||
message: HandleValue) {
|
||||
message: HandleValue,
|
||||
origin: Option<&str>) {
|
||||
let messageevent = MessageEvent::new(
|
||||
scope,
|
||||
atom!("message"),
|
||||
false,
|
||||
false,
|
||||
message,
|
||||
DOMString::new(),
|
||||
DOMString::from(origin.unwrap_or("")),
|
||||
DOMString::new());
|
||||
messageevent.upcast::<Event>().fire(target);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue