Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Get current ui.WebView URL
-
How can I get the URL of the currently loaded page in WebView?
-
Why don't you make a delegate and set a global variable whenever
should_start_load
is called. -
web_view.eval_js('window.location.href')
-
@omz's solution is far more elegant, disregard my answer.
-
@omz I didn't think of JavaScript. Thanks!
-
@omz Weird. That always returns a url starting with applewebdata://
-
@disorientedp Did you use
load_html
(and notload_url
) to load the page perhaps? -
I assume the currently displayed page comes from a
load_url
, not aload_html
? The latter doesn't include any location information, so thisapplewebdata://
URL is probably used as a substitute. -
@dgelessus yes, it comes from load_url
-
Maybe the page hasn't finished loading yet when you call this?
-
@omz Oh. That worked.