mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Ensure we get the post-redirect url
This commit is contained in:
parent
2a701cc339
commit
f44470ef52
6 changed files with 14 additions and 7 deletions
|
@ -873,6 +873,8 @@ impl ScriptTask {
|
|||
webdriver_handlers::handle_get_text(&page, pipeline_id, node_id, reply),
|
||||
WebDriverScriptCommand::GetFrameId(frame_id, reply) =>
|
||||
webdriver_handlers::handle_get_frame_id(&page, pipeline_id, frame_id, reply),
|
||||
WebDriverScriptCommand::GetUrl(reply) =>
|
||||
webdriver_handlers::handle_get_url(&page, pipeline_id, reply),
|
||||
WebDriverScriptCommand::GetTitle(reply) =>
|
||||
webdriver_handlers::handle_get_title(&page, pipeline_id, reply),
|
||||
WebDriverScriptCommand::ExecuteAsyncScript(script, reply) =>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue