清除浏览器历史记录后,Javascript中的localStorage是否会被删除 [英] Does localStorage in Javascript get wiped off after clearing browser history

查看:1001
本文介绍了清除浏览器历史记录后,Javascript中的localStorage是否会被删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题。

一旦用户清除了激活历史记录,localStorage是否会被删除?

Does localStorage get wiped off once the user clears the bowser history?

如果是,那么有一种方法可以将URL保存为移动设备上的字符串,即使用户或任何其他应用程序强制清除浏览器历史记录,也始终保留在那里。

If yes, then is there a way that I can save a URL as a string on the mobile device somewhere which always stays there even if the user or any other application forces the browser history to be cleared.

每当我需要它用于我的移动应用程序时,我都可以获得该字符串(URL)。

And I can go get that string(URL) whenever I need it for my mobile app.

我想保存的东西提取移动客户端更新的restful服务的URL。我希望每当用户第一次启动我的移动应用 时,他应该手动键入该URL(将由我提供)以获取更新,然后是一些我如何使用JavaScript用于在移动设备上保存该URL的API(即使删除了浏览器历史记录,该用户也永远无法删除),以便在每次后续启动时,用户无需再次键入该URL以获取更新以及更新退出移动应用程序应该能够自动获取保存的URL并联系服务以获取更新。

The thing is I want to save URL of a restful service which fetches updates to the mobile client. I want that whenever a user launches my mobile app for the first time only he should manually key-in that URL (that will be provided by me) to get the updates and then some how I use some JavaScript API to save that URL on mobile device(which user is never ever able to delete even if the browser history is deleted anyway)so that on every subsequent launch the user needs not to key-in that URL again for the updates and if the updates exit mobile app should automatically be able to get that saved URL and contact the service to fetch the updates.

谢谢。

推荐答案

一旦用户清除了激活历史记录,localStorage是否会被删除?

是localstorage删除浏览器数据后会被清除。

Yes localstorage does get cleared when browser data is removed.

将URL保存为移动设备上的字符串,即使用户或任何其他应用程序仍然存在强制浏览器历史记录为c le。。

您是在电话中使用浏览器中的实际移动应用程序还是网站?如果它是浏览器中的网站,则答案是否定的。

Are you refering to an actual mobile app or a website in a browser on a phone? If its a website within the browser then the answer is no.

如果您指的是实际的移动应用程序,那么有几种方法可以存储数据。如果是这种情况,您可能想要扩展您的问题。

If you are referring to an actual mobile app then there are several method to store data. You might want to expand you question if this is the case.

这篇关于清除浏览器历史记录后,Javascript中的localStorage是否会被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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