aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/webdriver_handlers.rs
diff options
context:
space:
mode:
authorJames Graham <james@hoppipolla.co.uk>2015-07-19 20:40:55 +0100
committerJames Graham <james@hoppipolla.co.uk>2015-07-19 20:40:55 +0100
commitf44470ef523edf27e8e2c855e564283089791388 (patch)
tree6175a5f255c3543505596ccad13255391d31183a /components/script/webdriver_handlers.rs
parent2a701cc3398cd9909477c2fb43f7e73cd7a97169 (diff)
downloadservo-f44470ef523edf27e8e2c855e564283089791388.tar.gz
servo-f44470ef523edf27e8e2c855e564283089791388.zip
Ensure we get the post-redirect url
Diffstat (limited to 'components/script/webdriver_handlers.rs')
-rw-r--r--components/script/webdriver_handlers.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs
index 591e38eb52b..e3b50cb2aaf 100644
--- a/components/script/webdriver_handlers.rs
+++ b/components/script/webdriver_handlers.rs
@@ -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();
+}