WebKit2.WebView.prototype.get_uri

function get_uri(): String {
    // Gjs wrapper for webkit_web_view_get_uri()
}
  

Returns the current active URI of web_view. The active URI might change during a load operation:

<orderedlist> <listitem><para> When nothing has been loaded yet on web_view the active URI is null. </para></listitem> <listitem><para> When a new load operation starts the active URI is the requested URI: <itemizedlist> <listitem><para> If the load operation was started by WebKit2.WebView.prototype.load_uri, the requested URI is the given one. </para></listitem> <listitem><para> If the load operation was started by WebKit2.WebView.prototype.load_html, the requested URI is "about:blank". </para></listitem> <listitem><para> If the load operation was started by WebKit2.WebView.prototype.load_alternate_html, the requested URI is content URI provided. </para></listitem> <listitem><para> If the load operation was started by WebKit2.WebView.prototype.go_back or WebKit2.WebView.prototype.go_forward, the requested URI is the original URI of the previous/next item in the WebKit2.BackForwardList of web_view. </para></listitem> <listitem><para> If the load operation was started by WebKit2.WebView.prototype.go_to_back_forward_list_item, the requested URI is the opriginal URI of the given WebKit2.BackForwardListItem. </para></listitem> </itemizedlist> </para></listitem> <listitem><para> If there is a server redirection during the load operation, the active URI is the redirected URI. When the signal WebKit2.WebView::load-changed is emitted with WebKit2.LoadEvent.redirected event, the active URI is already updated to the redirected URI. </para></listitem> <listitem><para> When the signal WebKit2.WebView::load-changed is emitted with WebKit2.LoadEvent.committed event, the active URI is the final one and it will not change unless a new load operation is started or a navigation action within the same page is performed. </para></listitem> </orderedlist>

You can monitor the active URI by connecting to the notify::uri signal of web_view.

Returns

the current active URI of web_view or null if nothing has been loaded yet.