同步localStorage [英] Syncing localStorage

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

问题描述

我正在寻找一种解决方案,允许浏览器的localStorage不在本地使用,以便人们可以在多个设备上访问其数据.传统的方法是在服务器上运行数据库并让人们登录.但我正试图避免这样做.我希望服务器端是轻量级的-如果可能的话甚至可以是完全静态的-并且不承担安全存储密码,担心数据保护等工作.

I'm looking for a solution that allows a browser's localStorage to be less local, so that people can access their data on multiple devices. The traditional way is to run a database on a server and have people log in; but I'm trying to avoid doing that. I'd like the server side to be lightweight - perhaps even completely static if possible - and to not have the job of safely storing passwords, worrying about data protection etc.

许多浏览器都有某种登录名-Google帐户,Firefox帐户等-将用户的浏览器联系在一起.因此,理想的解决方案是将数据存储在localStorage中,但使用该帐户在设备之间进行同步.诸如chrome.storage之类的界面似乎可用于打包的应用程序,但不适用于普通网页.

Many browsers have a login of some sort -- Google Account, Firefox Account etc -- that ties a user's browsers together. So the ideal solution would be to store data in localStorage, but use that account to sync across devices. There are interfaces such as chrome.storage that seem to be available to packaged apps, but not to ordinary web pages.

当前的技术有可能实现这种效果吗?

Is something like this possible with present technologies?

推荐答案

我会考虑使用诸如Firebase Web之类的工具,它将为您节省大量开发时间,并将所有客户同步到数据.

I would consider using a tool like firebase web, it would save you tons of time on development and it will sync all your clients to the data.

https://firebase.google.com/docs/storage/web/start

这篇关于同步localStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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