mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use the incumbent global as the source of x-origin postMessage
This commit is contained in:
parent
07dd37a0cf
commit
cef3f0e039
1 changed files with 5 additions and 1 deletions
|
@ -192,9 +192,13 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow {
|
|||
|
||||
impl DissimilarOriginWindow {
|
||||
pub fn post_message(&self, origin: Option<ImmutableOrigin>, data: StructuredCloneData) {
|
||||
let incumbent = match GlobalScope::incumbent() {
|
||||
None => return warn!("postMessage called with no incumbent global"),
|
||||
Some(incumbent) => incumbent,
|
||||
};
|
||||
let msg = ScriptMsg::PostMessage(self.window_proxy.browsing_context_id(),
|
||||
origin,
|
||||
data.move_to_arraybuffer());
|
||||
let _ = self.upcast::<GlobalScope>().script_to_constellation_chan().send(msg);
|
||||
let _ = incumbent.script_to_constellation_chan().send(msg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue