我正在寻找一种高效的方式来存储我的Chrome扩展中的大量数据。我有几个大约1-2mb的txt文件。 我想让我的Chrome扩展在本地“缓存”它们,所以我不需要每次都抓取它们。 我发现syncFileSystem但这只适用于打包应用程序。Chrome扩展存储大量数据
当试图安装这个扩展有警告:
“syncFileSystem”只允许打包应用程序,但是这是一个 扩展。
什么是在铬扩展中存储这种数据的最佳方式是什么?
的manifest.json
{
"manifest_version": 2,
"name": "__MSG_name__",
"version": "1.0",
"default_locale": "en",
"description": "__MSG_description__",
"icons" : {
"16" : "img/logo_enabled_16.png",
"48": "img/logo_enabled_48.png",
"128": "img/logo_enabled_128.png"
},
"browser_action": {
"default_icon": "img/logo_enabled_48.png",
"default_title": "__MSG_browser_action_title__",
"default_popup":"options.html"
},
"background": {
"scripts": [
"js/chrome.js",
"js/filter.js",
"js/background.js"
],
"persistent": true
},
"content_scripts": [{
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"js/docReady.js",
"js/content.js"
]
}],
"offline_enabled":true,
"options_ui": {
"chrome_style": true,
"page":"options.html"
},
"permissions": [
"activeTab",
"tabs",
"webRequest",
"webRequestBlocking",
"webNavigation",
"storage",
"syncFileSystem",
"http://*/*",
"https://*/*"
],
"short_name": "__MSG_shortName",
"minimum_chrome_version":"45.0.2454.101",
"web_accessible_resources":[
"css/bootstrap.min.css",
"js/jquery.min.js",
"js/chrome.js",
"js/bootstrap.min.js"
]
}
可以在问题中包含清单文件? – guest271314
我已经添加了我的清单文件 – SheperdOfFire