如何在 UIWebView 中删除 HTML5 持久数据库? [英] How to remove HTML5 persistant databases in UIWebView?

查看:26
本文介绍了如何在 UIWebView 中删除 HTML5 持久数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 UIWebView 的本机应用程序,并注意到 Google 等网站使用 HTML5 本地数据库来存储信息.我正在使用本机 API 来清除 cookie 存储中的项目,但清除持久性 cookie 存储对删除这些本地数据库没有任何作用.有没有办法通过本机 API 删除它们?

I have a native application that uses a UIWebView and notice that with sites like Google, they are using an HTML5 local database for storing information. I am using native APIs for clearing items out of the cookie store, but clearing the persistent cookie store does nothing to remove these local databases. Is there a way to remove them through a native API?

更新:

有没有办法通过非原生 API 或 javascript 来做到这一点?

Is there a way to do this through a non-native API or javascript?

推荐答案

你可以直接在你的 url 栏中运行这个 JavaScript:

You can run this JavaScript directly in your url bar:

javascript:localStorage.clear();

注意本地存储是同域范围的,所以它会清除存储的当前域.

Note that local storage is same domain scoped, so it will clear the storage of the current domain that you are.

目前 google 将其用于 google Analytics、adSense 等.

Currently google uses it for google Analytics, adSense, etc.

这篇关于如何在 UIWebView 中删除 HTML5 持久数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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