我目前正在处理Chrome扩展程序,我需要使用“chrome.storage.local.set”来保存数据。我在网上寻找教程和帮助,但我能找到的唯一解决方案是在我的权限中添加“存储”,但我已经做到了。 这是我的manifest.json:
{
"name": "Getting started example",
"description": "This extension allows the user to change the background
color of the current page.",
"version": "1.0",
"browser_action" : {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions" : [
"storage",
"activeTab"
],
"content_scripts": [{
"js": ["contentscript.js"],
"matches": ["*://csgofast.com/*"],
"all_frames": true
}],
"web_accessible_resources": [
"script.js"
],
"manifest_version": 2
}
下面我已经包含了我的内容脚本片段:
function wholeSc(){
chrome.storage.local.set({'csfast': "false"});
running = true;
当我跑的时候我得到了错误。
Picture of the error I get.