Android Webview私人浏览 [英] Android Webview private browsing

查看:64
本文介绍了Android Webview私人浏览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的android应用程序中使用webview从多个站点获取某些网页.我对网络视图的行为有疑问

I am using webview in my android app to fetch some webpages from multiple sites. I have some doubts regarding webview behavior

  1. webview是否存储历史记录,Cookie,表单自动填充信息?如果是,我们可以阻止它这样做吗?
  2. 如果Webview正在存储cookie,它是否会与手机上的其他普通浏览器共享cookie(使用webview打开时是否可以将存储在网站xyz中的信息存储在cookie中,当用户尝试从手机上的另一个浏览器打开网站时可以使用该信息)?

推荐答案

P1. WebView 是否存储历史记录,Cookie,表单自动填充信息?如果是,我们可以阻止它这样做吗?

P1. Does WebView store history, cookies, form autofill information? If yes, can we stop it from doing that?

[Ans]是, WebView 存储历史记录/Cookie和自动填充.

[Ans] Yes, WebView stores hisotry/ cookies and autofill.

要停止:

//Make sure No cookies are created
CookieManager.getInstance().setAcceptCookie(false); 

//Make sure no caching is done
myWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
myWebView.getSettings().setAppCacheEnabled(false);
myWebView.clearHistory();
myWebView.clearCache(true); 


//Make sure no autofill for Forms/ user-name password happens for the app
myWebView.clearFormData();
myWebView.getSettings().setSavePassword(false);
myWebView.getSettings().setSaveFormData(false); 

P2.如果 WebView 正在存储cookie,它是否与手机上的其他普通浏览器共享cookie(当使用"WebView"打开网站时,能否将信息存储在网站xyz的cookie中,当用户尝试从另一个网站打开网站时使用该信息)手机上的浏览器)?

P2. If WebView is storing cookies, does it share cookies with other normal browsers on phone (can info stored in cookie for a website xyz when opened using 'WebView`, be used when user tries to open website from another browser on phone)?

[回答]否.信息未与其他手机浏览器共享.

[Ans] No. Information is not shared with other phone browsers.

这篇关于Android Webview私人浏览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆