Ensure we get the post-redirect url

This commit is contained in:
James Graham 2015-07-19 20:40:55 +01:00
parent 2a701cc339
commit f44470ef52
6 changed files with 14 additions and 7 deletions

View file

@ -24,6 +24,7 @@ use js::jsval::UndefinedValue;
use ipc_channel::ipc::IpcSender;
use std::rc::Rc;
use url::Url;
fn find_node_by_unique_id(page: &Rc<Page>, pipeline: PipelineId, node_id: String) -> Option<Root<Node>> {
let page = get_page(&*page, pipeline);
@ -179,3 +180,10 @@ pub fn handle_get_name(page: &Rc<Page>,
None => Err(())
}).unwrap();
}
pub fn handle_get_url(page: &Rc<Page>,
_pipeline: PipelineId,
reply: IpcSender<Url>) {
let url = page.document().r().url();
reply.send(url).unwrap();
}