There is no way to get original URL of current webview.
Android webview is supporting it. [1]
So this patch adds ewk_view_original_url_get which can get original URL
of given webview.
[1] https://developer.android.com/reference/android/webkit/WebView.html#getOriginalUrl()
References:
https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/219988
Change-Id: I1d20b5549e28bd6fd4a2f5cb4321f037ecb5d620
Signed-off-by: yh106.jung <yh106.jung@samsung.com>
return web_contents_->GetVisibleURL();
}
+const GURL& EWebView::GetOriginalURL() const {
+ const auto entry = web_contents_->GetController().GetVisibleEntry();
+ if (entry)
+ return entry->GetOriginalRequestURL();
+
+ return web_contents_->GetVisibleURL();
+}
+
void EWebView::Reload() {
web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
}
// ewk_view api
void SetURL(const GURL& url);
const GURL& GetURL() const;
+ const GURL& GetOriginalURL() const;
void Reload();
void ReloadBypassingCache();
Eina_Bool CanGoBack();
return impl->GetURL().possibly_invalid_spec().c_str();
}
+const char* ewk_view_original_url_get(const Evas_Object* view)
+{
+ EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
+ return impl->GetOriginalURL().possibly_invalid_spec().c_str();
+}
Eina_Bool ewk_view_reload(Evas_Object *view)
{
return false;
}
-const char* ewk_view_original_url_get(const Evas_Object* o)
-{
- LOG_EWK_API_MOCKUP();
- return NULL;
-}
-
void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled)
{
LOG_EWK_API_MOCKUP();