Let the embedder decide if servo should follow a link or not

This commit is contained in:
Paul Rouget 2017-03-02 09:33:19 +01:00
parent d0856fd4cd
commit 79a5bf0cbf
6 changed files with 27 additions and 0 deletions

View file

@ -1575,6 +1575,13 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
}
fn load_url(&mut self, source_id: PipelineId, load_data: LoadData, replace: bool) -> Option<PipelineId> {
// Allow the embedder to handle the url itself
let (chan, port) = ipc::channel().expect("Failed to create IPC channel!");
self.compositor_proxy.send(ToCompositorMsg::AllowNavigation(load_data.url.clone(), chan));
if let Ok(false) = port.recv() {
return None;
}
debug!("Loading {} in pipeline {}.", load_data.url, source_id);
// If this load targets an iframe, its framing element may exist
// in a separate script thread than the framed document that initiated