send message to embedder in prompt_to_unload

This commit is contained in:
Gregory Terzian 2018-05-19 19:13:48 +08:00
parent 4234b1252a
commit 2812b3cf4a
3 changed files with 24 additions and 4 deletions

View file

@ -266,6 +266,13 @@ impl Browser {
self.event_queue.push(WindowEvent::SendError(browser_id, reason));
}
}
EmbedderMsg::AllowUnload(sender) => {
// Always allow unload for now.
if let Err(e) = sender.send(true) {
let reason = format!("Failed to send AllowUnload response: {}", e);
self.event_queue.push(WindowEvent::SendError(browser_id, reason));
}
}
EmbedderMsg::AllowNavigation(_url, response_chan) => {
if let Err(e) = response_chan.send(true) {
warn!("Failed to send allow_navigation() response: {}", e);