I'm looking for an efficient way to store large amounts of data in my chrome extension. I've got a few txt files which are around 1-2mb.
I'd like my chrome extension to 'cache' them locally so I don't need to fetch them every time.
I've found syncFileSystem but this is only available for packed apps.
There were warnings when trying to install this extension:
'syncFileSystem' is only allowed for packaged apps, but this is a
extension.
What is the best way to store this sort of data in a chrome extension?
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"
]
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…