Chrome扩展程序,存储数据 [英] Chrome extension, Store data

查看:153
本文介绍了Chrome扩展程序,存储数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过这个问题: Chrome扩展程序& Javasctipy Database ,但我想要一个更详细和更清晰的答案。



如何存储我的一些扩展设置?



是否可以使用数据库在JavaScript中执行此类操作?



有没有好的教程?



我不想使用本地存储,因为我不要希望SESSIONS的行为


$

解决方案

您可以使用 chrome.storage.sync chrome.storage.local 文档) 。两者都是本地存储(不是会话存储); 同步具有额外的优点,即它可以与用户的Google帐户同步,前提是他们已将Chrome连接到该帐户。


I've read this question: Chrome Extensions & Javasctipy Database but I want an answer with more details and more clear.

How can I store some of my extension settings?

Is it possible to use a database to do such things with JavaScript?

Is there any good tutorial on it?

I don't want to use Local Storage, because I do not want the behavior of SESSIONS

Thanks.

解决方案

You could use chrome.storage.sync or chrome.storage.local (docs). Both are local storage (not session storage); sync has the additional advantage that it syncs to the user's Google account if they've connected Chrome to it.

这篇关于Chrome扩展程序,存储数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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