android - Web历史记录项目 : URL vs Original URL

标签 android android-webview

WebHistoryItem的文档说:

URL

Return the url of this history item. The url is the base url of this history item. See getTargetUrl() for the url that is the actual target of this history item.

Original URL

Return the original url of this history item. This was the requested url, the final url may be different as there might have been redirects while loading the site.

这让我够困惑的了。我想知道的是,它们之间有什么区别?你能给我一些例子吗?

提前致谢。

最佳答案

嗯,在我做了一些研究之后,我发现了它们之间的差异。 原始URL是重定向之前的URL。假设您打开像这样的短链接 https://bit•ly/sG98iK,那么您将被重定向到具有以下 URL https://example.com/的网页android/tutorial/webview.html。我们将 https://bit•ly/sG98iK 称为原始 URLhttps://example.com/android/tutorial/webview.html as URL,即重定向后的URL。

请注意,原始 URL 可以为空

关于android - Web历史记录项目 : URL vs Original URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49525740/

相关文章:

android - 如何停止在Android上的通话记录中记录电话

android - 如何在android中为布局(顶部和底部)绘制两条水平线

android - 在 webview android 中单击图像时触发操作?

android - shouldOverrideUrlLoading 在电话未连接到互联网时未被调用

javascript - Android:window.getSelection() 在 webview 中不起作用

Android WebView关闭插页式视频广告后消失

java - 我如何与 rxAndroid 一起下载多个图像并在 OnNext 方法中获得单独的回调

java - Intent 在 Android 应用程序中隐藏 adview

android - Android 7+ 中 ar_IL 的 WebView 问题?

android - 如何使用 Eclipse 在我的 android 模拟器上安装 apk 文件?